diff options
author | ache <ache@FreeBSD.org> | 2008-07-22 10:31:29 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2008-07-22 10:31:29 +0000 |
commit | 31393d8a077bd95c3fa9ef23a427ae3c2c7860e6 (patch) | |
tree | 20eacad2e728a4a3256fe970e707e9a56fdd272b | |
parent | f3fc48dfb6e48d472aeae39d972853c63515b520 (diff) | |
download | FreeBSD-src-31393d8a077bd95c3fa9ef23a427ae3c2c7860e6.zip FreeBSD-src-31393d8a077bd95c3fa9ef23a427ae3c2c7860e6.tar.gz |
Increase initially dropped bytes from 512 to 768 (768 is also
suggested in the Ilya Mironov's article). 768 taken from another
research where it treats as default for RC4-drop(768):
http://www.users.zetnet.co.uk/hopwood/crypto/scan/cs.html#RC4-drop
Minor style tweak.
-rw-r--r-- | lib/libc/gen/arc4random.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index 68d727d..2e6ce11 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -123,7 +123,7 @@ arc4_stir(void) /* !done? Ah, what the heck. We'll just take whatever was on the * stack... */ if (!done) { - gettimeofday(&rdat.tv, NULL); + (void)gettimeofday(&rdat.tv, NULL); rdat.pid = getpid(); } @@ -132,12 +132,12 @@ arc4_stir(void) /* * Throw away the first N bytes of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. N=512 is based on + * by Fluher, Mantin, and Shamir. N=768 is based on * suggestions in the paper "(Not So) Random Shuffles of RC4" * by Ilya Mironov. */ if (rs_initialized != 1) { - for (n = 0; n < 512; n++) + for (n = 0; n < 768; n++) (void)arc4_getbyte(); rs_initialized = 1; } |