artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5aca46
)
Double usage of random() in the pseudo device to avoid setting
author
hugh
<hugh@openbsd.org>
Tue, 18 Apr 2000 15:11:28 +0000
(15:11 +0000)
committer
hugh
<hugh@openbsd.org>
Tue, 18 Apr 2000 15:11:28 +0000
(15:11 +0000)
every 32nd bit to zero in the output. Checked by mickey.
sys/dev/rnd.c
patch
|
blob
|
history
diff --git
a/sys/dev/rnd.c
b/sys/dev/rnd.c
index
5128e67
..
dede449
100644
(file)
--- a/
sys/dev/rnd.c
+++ b/
sys/dev/rnd.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rnd.c,v 1.3
7 2000/04/14 14:40:50 mickey Exp $
*/
+/* $OpenBSD: rnd.c,v 1.3
8 2000/04/18 15:11:28 hugh Exp $
*/
/*
* random.c -- A strong random number generator
@@
-967,7
+967,7
@@
randomread(dev, uio, ioflag)
case RND_PRND:
i = (n + 3) / 4;
while (i--)
- buf[i] = random();
+ buf[i] = random()
<< 16 | (random() & 0xFFFF)
;
break;
case RND_ARND:
{