/[pkg-mixmaster]/trunk/Mix/Src/random.c
ViewVC logotype

Diff of /trunk/Mix/Src/random.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 119 by rabbi, Wed Oct 31 08:19:51 2001 UTC revision 120 by weaselp, Sat Aug 3 17:08:02 2002 UTC
# Line 6  Line 6 
6     details.     details.
7    
8     Randomness     Randomness
9     $Id: random.c,v 1.1 2001/10/31 08:19:53 rabbi Exp $ */     $Id: random.c,v 1.2 2002/08/03 17:08:02 weaselp Exp $ */
10    
11    
12  #include "mix3.h"  #include "mix3.h"
# Line 23  Line 23 
23  #include <windows.h>  #include <windows.h>
24  #endif  #endif
25  #include <assert.h>  #include <assert.h>
26    #include <string.h>
27    
28  int rnd_state = RND_NOTSEEDED;  int rnd_state = RND_NOTSEEDED;
29    
# Line 110  void rnd_update(byte *seed, int l) Line 111  void rnd_update(byte *seed, int l)
111  #ifdef DEV_URANDOM  #ifdef DEV_URANDOM
112    fd = open(DEV_URANDOM, O_RDONLY);    fd = open(DEV_URANDOM, O_RDONLY);
113    if (fd != -1) {    if (fd != -1) {
114      read(fd, b, sizeof(b));      ssize_t ret;
115      rnd_add(b, sizeof(b));  
116        ret = read(fd, b, sizeof(b));
117        if (ret > 0) {
118          rnd_add(b, ret);
119        }
120      close(fd);      close(fd);
121    }    }
122  #endif  #endif

Legend:
Removed from v.119  
changed lines
  Added in v.120

  ViewVC Help
Powered by ViewVC 1.1.5