Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
rng.c File Reference
#include "rng.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
Include dependency graph for rng.c:

Go to the source code of this file.

Functions

void randombytes (void *x, size_t l)
 

Function Documentation

◆ randombytes()

void randombytes ( void x,
size_t  l 
)

Definition at line 13 of file rng.c.

14{
15 static __thread int fd = -1;
16 ssize_t n;
17 if (fd < 0 && 0 > (fd = open("/dev/urandom", O_RDONLY)))
18 exit(1);
19 for (size_t i = 0; i < l; i += n)
20 if (0 >= (n = read(fd, (char *) x + i, l - i)))
21 exit(2);
22#ifdef ENABLE_CT_TESTING
24#endif
25}
bytes read(int fd)
Definition ansi.py:223
ContextManager[TextIO] open(Union[str, "PathLike[str]", bytes] file, Union[Literal["rt"], Literal["r"]] mode, int buffering=-1, Optional[str] encoding=None, Optional[str] errors=None, Optional[str] newline=None, *Optional[int] total=None, str description="Reading...", bool auto_refresh=True, Optional[Console] console=None, bool transient=False, Optional[Callable[[], float]] get_time=None, float refresh_per_second=10, StyleType style="bar.back", StyleType complete_style="bar.complete", StyleType finished_style="bar.finished", StyleType pulse_style="bar.pulse", bool disable=False)
Definition progress.py:380
for i

References i.