13 static void randombytes_weak(unsigned char *x
, unsigned long long xlen
)
19 fdw
= open(LOW_ENTROPY_SOURCE
, O_RDONLY
);
32 ret
= read(fdw
, x
, ret
);
43 static void randombytes_strong(unsigned char *x
, unsigned long long xlen
)
47 fds
= open_or_die(HIG_ENTROPY_SOURCE
, O_RDONLY
);
49 ret
= read_exact(fds
, x
, xlen
, 0);
51 panic("Error reading from entropy source!\n");
60 randombytes_weak((void *) &ret
, sizeof(ret
));
65 void gen_key_bytes(unsigned char *area
, size_t len
)
67 randombytes_strong(area
, len
);