Browse Source

Set j = i after arc4random key schedule to be more like arc4 stream cipher;

from conversations between various people
OPENBSD_2_6
deraadt 25 years ago
parent
commit
8066fa51cc
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/lib/libc/crypt/arc4random.c

+ 2
- 1
src/lib/libc/crypt/arc4random.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random.c,v 1.4 1999/06/29 23:54:05 provos Exp $ */
/* $OpenBSD: arc4random.c,v 1.5 1999/09/28 01:24:48 deraadt Exp $ */
/* /*
* Arc4 random number generator for OpenBSD. * Arc4 random number generator for OpenBSD.
@ -77,6 +77,7 @@ arc4_addrandom(as, dat, datlen)
as->s[as->i] = as->s[as->j]; as->s[as->i] = as->s[as->j];
as->s[as->j] = si; as->s[as->j] = si;
} }
as->j = as->i;
} }
static void static void


Loading…
Cancel
Save