diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/rnd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 3bfc565c872..9c44c5ac193 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.51 2001/12/29 17:22:41 mickey Exp $ */ +/* $OpenBSD: rnd.c,v 1.52 2002/01/03 09:23:22 nordin Exp $ */ /* * random.c -- A strong random number generator @@ -862,8 +862,8 @@ extract_entropy(buf, nbytes) MD5Init(&tmp); s = splhigh(); MD5Update(&tmp, (u_int8_t*)rs->pool, sizeof(rs->pool)); - if (rs->entropy_count / 8 > i) - rs->entropy_count -= i * 8; + if (rs->entropy_count / 8 > nbytes) + rs->entropy_count -= nbytes * 8; else rs->entropy_count = 0; MD5Final(buffer, &tmp); |