Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2003 08:16:39 +0300
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/stdlib rand.c
Message-ID:  <20030217051639.GA27710@nagual.pp.ru>
In-Reply-To: <20030217045729.GA68471@rot13.obsecurity.org>
References:  <200302170352.h1H3qawJ062671@repoman.freebsd.org> <20030217045729.GA68471@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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

On Sun, Feb 16, 2003 at 20:57:29 -0800, Kris Kennaway wrote:
> On Sun, Feb 16, 2003 at 07:52:35PM -0800, Andrey A. Chernov wrote:
>=20
> >   So, monotonically increased seed->first value correlation problem rem=
ains...
>=20
> I think we should commit this patch (to -current) and fix all the
> problems that pop up.  For example, it's used in awk (which started
> this set of changes), and in some of the XFree86 libraries.

I agree. (diff is for old rand.c, but idea is clear in anycase).

I have no fancy ideas how to fix correlation problem AND keep rand_r()
compatibility at the same time. All linear mod-type generators share this
problem with monotonic seeding and usual solution is shuffling array (more
complex code than I use), but it will be incompatible with rand_r() again.

If we back out most of changes and return to very first formulae with=20
overflow, we
1) Make monotonic increasing for seed->first_value less visible.
2) Not fix seed->first_value correlation (taking some parts of bits
will show repeated pattern).
3) Make distribution and lower bits bad.

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

--qMm9M+Fa2AknHoGS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iQCVAwUBPlBwN+JgpPLZnQjrAQGwBQQApVvTqRAxzggEO1hs1Pdq7d/1680Kl8QQ
Wza3gJi6rJv8Duorh0kKBRC4Vi7amL4HMhf85clNBMPTfFTrF1k8hZ4p77Lt/J8T
tY9LfRmhEYFfCQPAINbEWxVw33si6FcsaSF+Zdqyt6hZiItmDSKUrAM+nLnAXovy
IOB2pdybtD0=
=KcEp
-----END PGP SIGNATURE-----

--qMm9M+Fa2AknHoGS--

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?20030217051639.GA27710>