From abdc3744fad5258534cc778e35e5fdf43a8616cd Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 4 Feb 2003 11:33:09 +0000 Subject: Drop NSHUFF values right after srandom() to remove part of seed -> 1st value correlation. Correlation still remains because of algorithm limits. --- sys/libkern/random.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys') diff --git a/sys/libkern/random.c b/sys/libkern/random.c index 1145a84..e390cde 100644 --- a/sys/libkern/random.c +++ b/sys/libkern/random.c @@ -36,13 +36,19 @@ #include +#define NSHUFF 100 /* to drop part of seed -> 1st value correlation */ + static u_long randseed = 1; void srandom(seed) u_long seed; { + int i; + randseed = seed; + for (i = 0; i < NSHUFF; i++) + (void)random(); } /* -- cgit v1.1