diff options
author | ache <ache@FreeBSD.org> | 2003-02-04 11:33:09 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2003-02-04 11:33:09 +0000 |
commit | abdc3744fad5258534cc778e35e5fdf43a8616cd (patch) | |
tree | 961100e9eb2b8dff7b14ae8d86dbbe604151f7f2 /sys/libkern | |
parent | 406a1bc7bbfd2c7d241946c23ede8ec59fd436e2 (diff) | |
download | FreeBSD-src-abdc3744fad5258534cc778e35e5fdf43a8616cd.zip FreeBSD-src-abdc3744fad5258534cc778e35e5fdf43a8616cd.tar.gz |
Drop NSHUFF values right after srandom() to remove part of seed -> 1st
value correlation. Correlation still remains because of algorithm limits.
Diffstat (limited to 'sys/libkern')
-rw-r--r-- | sys/libkern/random.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 <sys/libkern.h> +#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(); } /* |