Subject: Re: replace kernel random number function
To: None <>
From: Kenjiro Cho <>
List: tech-kern
Date: 10/23/2000 23:43:41 wrote:
> >> 	deraadt told me that i should not replace random(9), as there can be
> >> 	some code depending on poorness, or uniformity, of random(9).
> >???  Can you/he point to some examples of this?  Sounds a little bit
> >suspect to me...
> 	sys/arch/sparc/sparc/clock.c assumes that random(9) returns uniform
> 	random number (at least the comment says so).
> 	if we take a safer side, we should not replace random(9), or we should
> 	repalce random(9) with a random number generator with uniform
> 	number distribuion.  i still am not really sure if it matters (i
> 	suspect it does not).

Traditionally, uniformity is the most important property of a
pseudo-random generator in computer science.
Also, in the Internet research, lots of new algorithms such as RED
employ probablistic behavior.  The curent random() is good for them.

I believe that the algorithm was designed for the following
 - its cycle should be as long as possible
 - "random() % N" should be fairly uniform for any N (32bit interger)

I read the original paper a long time ago, so, I could be mistaken.
"Random number generators: good ones are hard to find",
Park and Miller, Communications of the ACM, vol. 31, no. 10,
October 1988, p. 1195.