From owner-freebsd-current Sun Feb 2 16: 3:41 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 B2F7237B401 for ; Sun, 2 Feb 2003 16:03:40 -0800 (PST) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3C4A43F75 for ; Sun, 2 Feb 2003 16:03:39 -0800 (PST) (envelope-from fanf@chiark.greenend.org.uk) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 18fU5K-0006VP-00 (Debian); Mon, 03 Feb 2003 00:03:38 +0000 To: mark@grondar.org From: Tony Finch Cc: current@freebsd.org Subject: Re: rand() is broken In-Reply-To: <200302021836.h12Ia2aX049696@grimreaper.grondar.org> References: <20030202182009.GA66318@nagual.pp.ru> Message-Id: Date: Mon, 03 Feb 2003 00:03:38 +0000 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: > >3) int random(void) which returns a number statistically > random in all bits. > >We have most of this, and RC4 can deliver. RC4's "licence" is >fine. Call it "ArCFour" and there is no problem. The code is >small, fast and repeatable, and meets conditions 1-4 above. Note that POSIX 2001 states that random() uses a non-linear additive feedback random-number generator, and strongly implies that rand() uses the traditional brain-dead algorithm. Tony. -- f.a.n.finch http://dotat.at/ SOLE LUNDY FASTNET: WEST VEERING NORTHWEST 6 OR 7, OCCASIONALLY GALE 8. RAIN OR SQUALLY SHOWERS. MODERATE OR GOOD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message