cvs commit: src/sys/libkern arc4random.c

Mike Silbersack silby at silby.com
Sat Aug 23 09:57:07 PDT 2003


On Sat, 23 Aug 2003, David Schultz wrote:

> Another test suite, which seems to be highly regarded, is
> Marsaglia's DIEHARD package.  The sources themselves are probably
> on the web somewhere, and there's some sample output from the last
> time the subject of randomness came up on the lists at
> http://www.csua.berkeley.edu/~das/marsaglia/ .
> I can run it again if there's interest.

Can you turn it into a port? :)

> I'm not a cryptographer, but FWIW, I'm told that there are
> statistical tests that can differentiate an ARC4 sequence from a
> truly random sequence.  However, it takes something like 2^31 bits
> of data to detect the statistical bias.

According to the paper referenced in the comment, the pattern is
*especially* apparent in the first 256 words of output, which is why they
should be thrown out.  (From my original reading of the paper, I was
unable to determine if by his terminology he meant the first 256 bytes,
words, dwords, quadwords, or what.  So I throw away the first 256 dwords,
just to be safe.)

Mike "Silby" Silbersack


More information about the cvs-src mailing list