Module Name: src Committed By: snj Date: Wed Jan 20 05:36:09 UTC 2010
Modified Files: src/sys/lib/libkern [netbsd-5-0]: arc4random.c Log Message: Pull up following revision(s) (requested by joerg in ticket #1253): sys/lib/libkern/arc4random.c: revision 1.21 Keep arc4_i and arc4_j synchronised after a rekeying. This prevents accidentally ending up in a short ARC4 cycle. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.20.16.1 src/sys/lib/libkern/arc4random.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/lib/libkern/arc4random.c diff -u src/sys/lib/libkern/arc4random.c:1.20 src/sys/lib/libkern/arc4random.c:1.20.16.1 --- src/sys/lib/libkern/arc4random.c:1.20 Mon Apr 28 20:24:06 2008 +++ src/sys/lib/libkern/arc4random.c Wed Jan 20 05:36:09 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: arc4random.c,v 1.20 2008/04/28 20:24:06 martin Exp $ */ +/* $NetBSD: arc4random.c,v 1.20.16.1 2010/01/20 05:36:09 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -136,6 +136,7 @@ arc4_j = (arc4_j + arc4_sbox[n] + key[n]) % 256; arc4_swap(&arc4_sbox[n], &arc4_sbox[arc4_j]); } + arc4_i = arc4_j; /* Reset for next reseed cycle. */ arc4_nextreseed = time_uptime + ARC4_RESEED_SECONDS;