Juan Lang juan_lang at
Fri Oct 29 11:02:14 CDT 2004

Michael wrote:
> If I use /dev/random in my patch the unit tests take more than three
> minutes without any user interaction. As to be expected, it runs faster
> if I move the mouse around wildly to generate entropy => 

You're right, this seems unreasonable for 32 bytes of random data,
especially in this context.  Alexandre has the final word anyway, so
submitting to wine-patches was a good idea.  Again, sorry I didn't see all
this up front, but I'd like to suggest the following improvement:

If OpenSSL is available, go ahead and use RAND_bytes, but call RAND_add
first with the input buffer.  I don't have a good estimate for the number
of bits of entropy to expect, since we don't know whether the caller will
actually have provided a seed.  Assuming it's unlikely, maybe
RAND_add(pbBuffer, dwLen, dwLen / 16.0f)?

And go ahead and fall back to /dev/urandom if OpenSSL isn't available.


Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish. 

More information about the wine-devel mailing list