diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-08-10 17:49:55 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-08-10 17:49:55 +0000 |
commit | 40220dde01a8da89fedfb7c78b1c485714ab6ef7 (patch) | |
tree | ce96c1b258878f53bebcbbf42c53f30269bf35a2 /lib/libc/stdlib/random.c | |
parent | 4cca7f0aed389a4458e4c91785c6ae8efe98e79d (diff) | |
download | src-40220dde01a8da89fedfb7c78b1c485714ab6ef7.tar.gz src-40220dde01a8da89fedfb7c78b1c485714ab6ef7.zip |
For type 0 rng lower initial drop to 50, it is enough to hide linearity
Reorganize historic #ifdef section
Notes
Notes:
svn path=/head/; revision=118731
Diffstat (limited to 'lib/libc/stdlib/random.c')
-rw-r--r-- | lib/libc/stdlib/random.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 64310cd8685e..df4a0e4cf166 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -142,7 +142,11 @@ __FBSDID("$FreeBSD$"); */ #define MAX_TYPES 5 /* max number of types above */ -#define NSHUFF 100 /* to drop part of seed -> 1st value correlation */ +#ifdef USE_WEAK_SEEDING +#define NSHUFF 0 +#else /* !USE_WEAK_SEEDING */ +#define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ +#endif /* !USE_WEAK_SEEDING */ static long degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static long seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; |