From owner-freebsd-current Tue Feb 4 1:47: 5 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 A4D6937B401 for ; Tue, 4 Feb 2003 01:47:03 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DADE43E4A for ; Tue, 4 Feb 2003 01:47:01 -0800 (PST) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.6/8.12.6) with ESMTP id h149l0d6087546; Tue, 4 Feb 2003 12:47:00 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.6/8.12.6/Submit) id h149kxNZ087545; Tue, 4 Feb 2003 12:46:59 +0300 (MSK) (envelope-from ache) Date: Tue, 4 Feb 2003 12:46:59 +0300 From: "Andrey A. Chernov" To: Kris Kennaway , current@FreeBSD.ORG Subject: Re: rand() is broken Message-ID: <20030204094659.GA87303@nagual.pp.ru> References: <20030202070644.GA9987@rot13.obsecurity.org> <20030202090422.GA59750@nagual.pp.ru> <20030203002639.GB44914@HAL9000.homeunix.com> <20030203100002.GA73386@nagual.pp.ru> <20030204054020.GA2447@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030204054020.GA2447@HAL9000.homeunix.com> User-Agent: Mutt/1.5.1i 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 On Mon, Feb 03, 2003 at 21:40:20 -0800, David Schultz wrote: > followed by a 5 or 6. There is a similar pattern for 'e a 7'. I > think this pretty much demonstrates that the algorithm isn't good > enough to generate high-quality randomness with respect to > different seed values. I'm not suggesting that it absolutely must > be replaced, since most rand() implementations aren't very good in > the first place, but I'm pointing out that to do a good job of > fixing it once and for all is harder than you might think. I don't try to make rand() good for high-quality pseudo-randomness, because it can be done by price of speed and, more important, big state size. Due to rand_r() restriction state size can be one word only, so we can choose rand() algorithm only from those which pass this restrictions. So, if you define USE_WEAK_SEEDING and re-compile rand.c, you'll get even worse results from your test. It means current variant is better then previous. If you know even better algorithm wich pass restrictions above, just tell and we consider switching to it. Returning to current algorithm, I am interested in good NSHUFF value in the range 100-2000. Do you have any findings there? -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message