8 static int fd_rnd
= -1;
10 static void randombytes(unsigned char *x
, unsigned long long xlen
)
16 fd_rnd
= open("/dev/urandom", O_RDONLY
);
29 ret
= read(fd_rnd
, x
, ret
);
40 /* Note: it's not really secure, but the name only suggests it's better to use
41 * than rand(3) when transferring bytes over the network in non-security
42 * critical structure members. secrand() is only used to fill up salts actually.
47 randombytes((void *) &ret
, sizeof(ret
));