Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2003 21:53:50 +0300
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
To:        Mark Murray <mark@grondar.org>
Cc:        current@FreeBSD.ORG
Subject:   Re: rand() is broken
Message-ID:  <20030202185350.GB66622@nagual.pp.ru>
In-Reply-To: <200302021836.h12Ia2aX049696@grimreaper.grondar.org>
References:  <20030202182009.GA66318@nagual.pp.ru> <200302021836.h12Ia2aX049696@grimreaper.grondar.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 02, 2003 at 18:36:02 +0000, Mark Murray wrote:

> I think we need four things.
> 
> 1) void srandom(int arg) which uses the argument to seed.
> 2) void srandomdev(void) which uses system entropy to seed.
> 3) int random(void) which returns a number statistically
>    random in all bits.
> 4) <something else> which returns as many bytes of randomness
>    (statistically random in all bits) as the caller asks for.
> 
> 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.
> 
> Coding is Junior-high-school level, given the spec.

random() is not needed to be changed at all, it already use algorithm
which is resistent to bad initial steering PseudoRNG as designed.

The RNG in question is rand() only. 

-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030202185350.GB66622>