diff options
author | Xin LI <delphij@FreeBSD.org> | 2017-03-14 06:12:51 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2017-03-14 06:12:51 +0000 |
commit | c80e2a01fc1a42d76c26c1eb0cd7676b6fc58c11 (patch) | |
tree | 582e911b983b7b54c95c518c45f09a401c3e43ca | |
parent | 77ea9d16354468b7bf75f2349ae2c1e417720891 (diff) |
Notes
-rw-r--r-- | lib/libc/gen/arc4random.c | 2 | ||||
-rw-r--r-- | sys/libkern/arc4random.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index 59c4f7fd1dc7..8e231cd06cce 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -172,7 +172,7 @@ arc4_stir(void) * Discard early keystream, as per recommendations in: * "(Not So) Random Shuffles of RC4" by Ilya Mironov. */ - for (i = 0; i < 1024; i++) + for (i = 0; i < 3072; i++) (void)arc4_getbyte(); arc4_count = 1600000; } diff --git a/sys/libkern/arc4random.c b/sys/libkern/arc4random.c index 62ace2cb5985..6e8b33944f75 100644 --- a/sys/libkern/arc4random.c +++ b/sys/libkern/arc4random.c @@ -80,9 +80,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); mtx_unlock(&arc4_mtx); } |