diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-06-11 21:03:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-06-11 21:03:11 +0000 |
commit | 4dba6a5e639357ec5b17c397ad648b7c98e3ba12 (patch) | |
tree | 108501f056c58743e71328f45cbc63154295e75a /lib/libc/crypt/arc4random.c | |
parent | e9c67dcf958b38635d2c444765b8d17227635cc5 (diff) |
ansification; checked by pval
Diffstat (limited to 'lib/libc/crypt/arc4random.c')
-rw-r--r-- | lib/libc/crypt/arc4random.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/libc/crypt/arc4random.c b/lib/libc/crypt/arc4random.c index a41001bcc3d..b23b1955e42 100644 --- a/lib/libc/crypt/arc4random.c +++ b/lib/libc/crypt/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.7 2003/02/14 17:12:54 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.8 2003/06/11 21:03:10 deraadt Exp $ */ /* * Arc4 random number generator for OpenBSD. @@ -49,8 +49,7 @@ static struct arc4_stream rs; static pid_t arc4_stir_pid; static inline void -arc4_init(as) - struct arc4_stream *as; +arc4_init(struct arc4_stream *as) { int n; @@ -61,10 +60,7 @@ arc4_init(as) } static inline void -arc4_addrandom(as, dat, datlen) - struct arc4_stream *as; - u_char *dat; - int datlen; +arc4_addrandom(struct arc4_stream *as, u_char *dat, int datlen) { int n; u_int8_t si; @@ -81,8 +77,7 @@ arc4_addrandom(as, dat, datlen) } static void -arc4_stir(as) - struct arc4_stream *as; +arc4_stir(struct arc4_stream *as) { int fd; struct { @@ -119,8 +114,7 @@ arc4_stir(as) } static inline u_int8_t -arc4_getbyte(as) - struct arc4_stream *as; +arc4_getbyte(struct arc4_stream *as) { u_int8_t si, sj; @@ -134,8 +128,7 @@ arc4_getbyte(as) } static inline u_int32_t -arc4_getword(as) - struct arc4_stream *as; +arc4_getword(struct arc4_stream *as) { u_int32_t val; val = arc4_getbyte(as) << 24; @@ -146,7 +139,7 @@ arc4_getword(as) } void -arc4random_stir() +arc4random_stir(void) { if (!rs_initialized) { arc4_init(&rs); @@ -156,9 +149,7 @@ arc4random_stir() } void -arc4random_addrandom(dat, datlen) - u_char *dat; - int datlen; +arc4random_addrandom(u_char *dat, int datlen) { if (!rs_initialized) arc4random_stir(); @@ -166,7 +157,7 @@ arc4random_addrandom(dat, datlen) } u_int32_t -arc4random() +arc4random(void) { if (!rs_initialized || arc4_stir_pid != getpid()) arc4random_stir(); |