[edk2-devel] why does RAND_add() take "randomness" as a "double"?

Ard Biesheuvel ard.biesheuvel at linaro.org
Fri May 24 15:30:49 UTC 2019


(remove openssl user list)

On Wed, 22 May 2019 at 03:48, Paul Dale <paul.dale at oracle.com> wrote:
>
> Double makes sense.  Entropy is often estimated as a real value.
>
> E.g. we have the aforementioned coin flipper feeding data serially.
> Adding each bit sequentially means 0.125 bytes of entropy per call.
>
> Not the best example....
>

It looks like the people saying double is a good idea didn't actually
look at the code. The double argument is compared to a size_t cast to
double, and assigned that same value under some conditions.

I think the problem is that the double argument is part of the RAND
API, so they cannot easily change it.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41345): https://edk2.groups.io/g/devel/message/41345
Mute This Topic: https://groups.io/mt/31696120/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list