Fixed some typos, verboseness and misformatting in comments.

This commit is contained in:
Bruce Evans 2001-08-30 12:30:58 +00:00
parent 142277ce04
commit 60f8e3af92
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82565

View File

@ -46,11 +46,12 @@ arc4_randomstir (void)
u_int8_t key[256];
int r, n;
/* XXX read_random() returns unsafe numbers if the entropy
* devce is not loaded - MarkM
/*
* XXX read_random() returns unsafe numbers if the entropy
* device is not loaded -- MarkM.
*/
r = read_random(key, ARC4_KEYBYTES);
/* if r == 0 || -1, just use what was on the stack */
/* If r == 0 || -1, just use what was on the stack. */
if (r > 0)
{
for (n = r; n < sizeof(key); n++)
@ -84,11 +85,10 @@ arc4_init(void)
arc4_randomstir();
arc4_initialized = 1;
/* Now, throw away the first N words out output, as suggested
* in the paper "Weaknesses in the Key Scheduling Algorithm
* of RC4" by Fluher, Mantin, and Shamir.
*
* (N = 256 in our case.)
/*
* 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.)
*/
for (n = 0; n < 256*4; n++)
arc4_randbyte();
@ -121,9 +121,7 @@ arc4random(void)
if (!arc4_initialized)
arc4_init();
/* Get current time. */
getmicrotime(&tv_now);
if ((++arc4_numruns > ARC4_MAXRUNS) ||
(tv_now.tv_sec > arc4_tv_nextreseed.tv_sec))
{