Skip site navigation (1)Skip section navigation (2)
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

--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Feb 02, 2003 at 01:11:06 -0800, Kris Kennaway wrote:
>=20
> 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().
>=20
> 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=
=20
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.

--=20
Andrey A. Chernov
http://ache.pp.ru/

--SUOF0GtieIMvvwua
Content-Type: application/pgp-signature
Content-Disposition: inline

-----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-----

--SUOF0GtieIMvvwua--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030202092718.GA60116>