1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.

PR:		217920
Submitted by:	codarren@hackers.mu
Reviewed by:	emaste, cem
Approved by:	so (implicit, in r315225)
MFC after:	1 week
Differential Revision:	D11747
Patterned after:	r315225
This commit is contained in:
Cy Schubert 2017-07-27 06:26:15 +00:00
parent 99cc4d5177
commit 223428af47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321605

View File

@ -109,9 +109,9 @@ arc4_randomstir (void)
/* /*
* Throw away the first N words of output, as suggested in the * Throw away the first N words of output, as suggested in the
* paper "Weaknesses in the Key Scheduling Algorithm of RC4" * 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(); arc4_randbyte();
MUTEX_EXIT(&arc4_mtx); MUTEX_EXIT(&arc4_mtx);
} }