Le lundi 22 mars 2010 à 17:49 -0700, Jeremy Huddleston a écrit :
> I was thinking smaller would be more "acceptable" ... but I too would  
> prefer something like OsRandom() in os/utils.c ... 

I would prefer too, since GNU libc doesn't have a definition for
arc4random, something like OsRandom() would be definitely better.
You should also specify known output range for the PRNG:
rand() returns an int in range [0..RAND_MAX] while arc4random() returns
an uint32_t with range [0..2^32-1].


(Let me introduce you to "hasard" library, a portable random generator
library:

 http://bitbucket.org/haypo/hasard/wiki/Home
 http://bitbucket.org/haypo/hasard/

This library could be use to wrote a portable OsRandom(), with a fast,
non secure PRNG.)

Regards.

-- 
Yann Droneaud



_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to