diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-12-29 18:17:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-12-29 18:17:00 +0000 |
commit | 4b025ae0c9ab26c48a400e768c687e5ae15589c5 (patch) | |
tree | 32e4e1c2c151146d1ebf468e9b2f4ed8415e5a30 /sys/dev/rnd.c | |
parent | c3fdb77601d94cb163844b92e7a89c70e28dc2ae (diff) |
Remove the get_random_bytes() API.
ok kjell djm
Diffstat (limited to 'sys/dev/rnd.c')
-rw-r--r-- | sys/dev/rnd.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 0709f5dac4c..d231c6c2e33 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.107 2010/12/29 17:51:48 deraadt Exp $ */ +/* $OpenBSD: rnd.c,v 1.108 2010/12/29 18:16:59 deraadt Exp $ */ /* * rnd.c -- A strong random number generator @@ -695,19 +695,6 @@ struct rc4_ctx arc4random_state; int arc4random_initialized; u_long arc4random_count = 0; -/* - * This function returns some number of good random numbers but is quite - * slow. Please use arc4random_buf() instead unless very high quality - * randomness is required. - * XXX: rename this - */ -void -get_random_bytes(void *buf, size_t nbytes) -{ - extract_entropy((u_int8_t *) buf, nbytes); - rndstats.rnd_used += nbytes * 8; -} - static void arc4_stir(void) { @@ -716,9 +703,8 @@ arc4_stir(void) nanotime((struct timespec *) buf); len = sizeof(buf) - sizeof(struct timespec); - get_random_bytes(buf + sizeof (struct timespec), len); + extract_entropy((u_int8_t *)(buf + sizeof (struct timespec)), len); len += sizeof(struct timespec); - mtx_enter(&rndlock); if (rndstats.arc4_nstirs > 0) rc4_crypt(&arc4random_state, buf, buf, sizeof(buf)); |