From owner-freebsd-current Sun Feb 2 15:41:44 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9206737B401; Sun, 2 Feb 2003 15:41:43 -0800 (PST) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09CF943E4A; Sun, 2 Feb 2003 15:41:43 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0402.cvx21-bradley.dialup.earthlink.net ([209.179.193.147] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18fTju-0005iN-00; Sun, 02 Feb 2003 15:41:31 -0800 Message-ID: <3E3DAC54.13A68DE6@mindspring.com> Date: Sun, 02 Feb 2003 15:40:04 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mark Murray Cc: "Jeroen C. van Gelderen" , phk@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: rand() is broken References: <200302021532.h12FWWaX047973@grimreaper.grondar.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4169df1a3a57d4cc46ce714fc0ddea954666fa475841a1c7a350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mark Murray wrote: > "Jeroen C. van Gelderen" writes: > > Wouldn't it be a good idea to change the name at the same time? Or > > should it be retained for compatibility reasons with other BSDs? > > > > Currently the name needlessly exposes implementation detail. Callers > > expect good, cheap, non-blocking randomness but don't give a hoot if > > that is actually provided trough use of RC4 or not. I see no reason why > > the implementation could be changed if the contract is maintained. > > Good point. We can re-implement random() internally with arc4rand(). > > Objections? The same objections I always raise when someone replaces a PRNG that allows repeatable results with old software with a new one, that does not, I guess. BTW: if /dev/random is so damn good, why are you using it as an implementation detail for these functions, instead of adding yet another backward-incompatible algorithm? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message