Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
rng.c
Go to the documentation of this file.
1
2#include "rng.h"
3
4#include <stdlib.h>
5#include <unistd.h>
6#include <fcntl.h>
7
8void randombytes(void *x, size_t l)
9{
10 static int fd = -1;
11 ssize_t n;
12 if (fd < 0 && 0 > (fd = open("/dev/urandom", O_RDONLY)))
13 exit(1);
14 for (size_t i = 0; i < l; i += n)
15 if (0 >= (n = read(fd, (char *) x + i, l - i)))
16 exit(2);
17}
void randombytes(void *x, size_t l)
Definition rng.c:8
for i