Date: Sun, 2 Feb 2003 12:27:18 +0300 From: "Andrey A. Chernov" <ache@nagual.pp.ru> To: Kris Kennaway <kris@obsecurity.org> Cc: current@FreeBSD.org Subject: Re: rand() is broken Message-ID: <20030202092718.GA60116@nagual.pp.ru> In-Reply-To: <20030202091106.GA72723@rot13.obsecurity.org> References: <20030202070644.GA9987@rot13.obsecurity.org> <20030202090422.GA59750@nagual.pp.ru> <20030202091106.GA72723@rot13.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Sun, Feb 02, 2003 at 01:11:06 -0800, Kris Kennaway wrote: > > Another problem (noticed by tjr) is that once the sequence hits '0' it > jumps to INT_MAX and stays there forever. For example, seeding with > srand(0) produces nothing but INT_MAX from rand(). > > It looks like a lot more validation of this PRNG is needed. Don't have an idea about this thing yet, maybe some sign or variable size change fix required. BTW, note that new formulae also used in the kernel (by BSD developers) and taken from there - libkern/random.c - so all you say is true there too. -- Andrey A. Chernov http://ache.pp.ru/ [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iQCVAwUBPjzkduJgpPLZnQjrAQHveAP/VcFwDHdMfrWbAcc6r2j4Kyb4niIz3vp2 9rW9/JjGsxTchj73mf7h/zET1klZ1JOjn42r7+svIkdiwBpiHlvVx9Z4h0tx+16W VHPK15tmiQHxbao55jALioe2PU/qm5/n5JzWtP7EYCh+UphngLx9ejZguwgVw1uM SGOVeq1y1oE= =2jVo -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030202092718.GA60116>
