From owner-freebsd-current Sun Feb 2 14:42: 0 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 40C3737B405 for ; Sun, 2 Feb 2003 14:41:59 -0800 (PST) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id F13DE43FA3 for ; Sun, 2 Feb 2003 14:41:57 -0800 (PST) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) by storm.FreeBSD.org.uk (8.12.6/8.12.6) with ESMTP id h12MfuLf081036; Sun, 2 Feb 2003 22:41:57 GMT (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost) by storm.FreeBSD.org.uk (8.12.6/8.12.6/Submit) with UUCP id h12Mfu4F081035; Sun, 2 Feb 2003 22:41:56 GMT X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1]) by grimreaper.grondar.org (8.12.6/8.12.6) with ESMTP id h12MZsaX052670; Mon, 3 Feb 2003 00:35:54 +0200 (SAST) (envelope-from mark@grondar.org) From: Mark Murray Message-Id: <200302022235.h12MZsaX052670@grimreaper.grondar.org> To: "Andrey A. Chernov" Cc: current@FreeBSD.ORG Subject: Re: rand() is broken In-Reply-To: Your message of "Mon, 03 Feb 2003 01:30:43 +0300." <20030202223043.GB68806@nagual.pp.ru> Date: Sun, 02 Feb 2003 22:35:54 +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 "Andrey A. Chernov" writes: > On Sun, Feb 02, 2003 at 22:19:33 +0000, Mark Murray wrote: > > > > 1) Implementing random(3) with RC4 is not needed, its algorithm is > > > already equal or better. > > > > Rubbish. :-) RC4's internal state is 256 bytes. In theory, its > > cycle-of-repetition is 2^(8*256) bits. > > This is comparable with random() TYPE4 which internal state is 252 bytes. I stand (somewhat) corrected. The random() code is _nasty_ complexity-wise. Its not obvious how it works. RC4 is 10-20 lines and clean with no magic numbers. M -- Mark Murray iumop ap!sdn w,I idlaH To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message