summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-18 12:28:22 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-10-18 12:28:22 +0000
commitda99a7cece56958f43942de58161b255659ac337 (patch)
tree1c519de164baff4c82dc845154bba95f6db88e7f
parent7bb3161a0d2664055a85a94de976149904584fb3 (diff)
-Wall happieness
-rw-r--r--sys/dev/rnd.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 136d45a8f45..339386b218a 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.9 1996/09/29 16:42:00 dm Exp $ */
+/* $OpenBSD: rnd.c,v 1.10 1996/10/18 12:28:21 mickey Exp $ */
/*
* random.c -- A strong random number generator
@@ -319,7 +319,6 @@ struct arc4_stream {
static struct random_bucket random_state;
struct arc4_stream arc4random_state;
static u_int32_t random_pool[POOLWORDS];
-static struct timer_rand_state keyboard_timer_state;
static struct timer_rand_state mouse_timer_state;
static struct timer_rand_state extract_timer_state;
static struct timer_rand_state net_timer_state[32]; /* XXX */
@@ -331,6 +330,16 @@ static int rnd_sleep = 0;
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
+/* called by main() at boot time */
+void randomattach __P((int num));
+
+static inline void add_entropy_word
+ __P((struct random_bucket *r, const u_int32_t input));
+static void add_timer_randomness __P((struct random_bucket *r,
+ struct timer_rand_state *state, u_int num));
+static inline int extract_entropy
+ __P((struct random_bucket *r, char *buf, int nbytes));
+
/* Arcfour random stream generator. This code is derived from section
* 17.1 of Applied Cryptography, second edition, which describes a
* stream cipher allegedly compatible with RSA Labs "RC4" cipher (the
@@ -679,7 +688,7 @@ get_random_bytes(buf, nbytes)
void *buf;
size_t nbytes;
{
- extract_entropy(&random_state, (char *) buf, nbytes, 0);
+ extract_entropy(&random_state, (char *) buf, nbytes);
}
int
@@ -730,7 +739,7 @@ randomread(dev, uio, ioflag)
printf("rnd: %u possible output\n", n);
#endif
case RND_URND:
- n = extract_entropy(&random_state, buf, n);
+ n = extract_entropy(&random_state, (char *)buf, n);
#ifdef DEBUG
if (rnd_debug & RD_OUTPUT)
printf("rnd: %u bytes for output\n", n);