From owner-freebsd-arch Sun Feb 25 15: 8:58 2001 Delivered-To: freebsd-arch@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id BD01437B491; Sun, 25 Feb 2001 15:08:49 -0800 (PST) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.2/8.11.2) id f1PN8US61069; Mon, 26 Feb 2001 02:08:31 +0300 (MSK) (envelope-from ache) Date: Mon, 26 Feb 2001 02:08:28 +0300 From: "Andrey A. Chernov" To: Kris Kennaway Cc: arch@FreeBSD.ORG, "Jacques A. Vidrine" , Matt Dillon , Bruce Evans , Robert Watson , Nick Sayer , cvs-all@FreeBSD.ORG Subject: Re: rand.c patch for review (was: Re: cvs commit: ports/astro/xglobe/files patch-random) Message-ID: <20010226020827.A61007@nagual.pp.ru> References: <200102250900.f1P90Qc12868@earth.backplane.com> <20010225092416.A46959@hamlet.nectar.com> <20010225185535.A55782@nagual.pp.ru> <20010225191316.A56093@nagual.pp.ru> <20010225193409.A56351@nagual.pp.ru> <20010225131002.A38192@mollari.cthul.hu> <20010225132152.A39554@mollari.cthul.hu> <20010226005004.B59772@nagual.pp.ru> <20010225135429.A47615@mollari.cthul.hu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010225135429.A47615@mollari.cthul.hu>; from kris@obsecurity.org on Sun, Feb 25, 2001 at 01:54:29PM -0800 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 25, 2001 at 13:54:29 -0800, Kris Kennaway wrote: > On Mon, Feb 26, 2001 at 12:50:04AM +0300, Andrey A. Chernov wrote: > > On Sun, Feb 25, 2001 at 13:21:52 -0800, Kris Kennaway wrote: > > > Nevermind, I read the followup about needing to have independent > > > state. I think you should duplicate the rest of the random() and > > > srandom() stuff, not just good_rand() -- random.c does more work to > > > seed things, for example, which I'd feel better about. Also, document > > > in rand.c and random.c that they should be kept in sync modulo the > > > missing srandomdev() code. > >=20 > > Maybe, but only in case we need to care about rand() distribution _so_ > > match, I am not sure. Every manual nowdays marks rand() as deprecated. >=20 > Yet it's still used bogusly for cryptographic needs - e.g. even > XFree86 4.x seems to use rand() for generating cookies, I discovered > last night (as a result of my rand() warning :-). If we fix up rand() > to have a decent cryptographic behaviour, we save all the idiot > programmers from themselves. Bad news: we can't implement r_rand() via random() algorithm because r_rand() keeps its state in extenal unsigned variable (not in big table needed for random()). So, I suggest again to use my patch since it _is_ r_rand() compatible. --=20 Andrey A. Chernov http://ache.pp.ru/ --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia iQCVAwUBOpmQa+JgpPLZnQjrAQHqNwP7BKxpiO0l+r2jxxU7bfFeboN9y9+4rOe6 +O7HA/omuUTfIipvCpXN/J4aO0rhn9ra4nbZWRjGhDMe6/RXAjaR+pI4Z8md/4uF O1hf4vr6uhZiMTNRvhPEv10EwO8NeT1hBEJTrRuD9a6MCxFJxdx2hvd185o4rX6z 5TuVZGOJbB4= =/03r -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message