cvs commit: src/lib/libc/gen arc4random.c

Andrey Chernov ache at nagual.pp.ru
Tue Jul 22 10:48:30 UTC 2008


On Tue, Jul 22, 2008 at 10:34:51AM +0000, Poul-Henning Kamp wrote:
> In message <200807221031.m6MAVe9I012301 at repoman.freebsd.org>, "Andrey A. Cherno
> v" writes:
> 
> >  Increase initially dropped bytes from 512 to 768 (768 is also
> >  suggested in the Ilya Mironov's article). 768 taken from another
> >  research where it treats as default for RC4-drop(768):
> >  http://www.users.zetnet.co.uk/hopwood/crypto/scan/cs.html#RC4-drop
> 
> I've always wondered why the dropped number of bytes is constant,
> wouldn't it be smarter to drop a constant number, and then pull
> out the next byte and drop that many further bytes ?

From math point of view, small pseudo-random dropping fraction added will 
not increase distribution significantly. With good seeding from the kernel 
PRNG even 256 bytes is enough (as OpenBSD currently does). It is just for 
formal RC4-drop(768) implementation as it described and for rare corner 
cases when /dev/urandom is unavailable.

-- 
http://ache.pp.ru/


More information about the cvs-src mailing list