ELinks 0.18.0
|
Random numbers. More...
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "elinks.h"
#include "util/random.h"
Functions | |
void | seed_rand_once (void) |
static void | pseudorandom_nonce (unsigned char buf[], size_t size) |
void | random_nonce (unsigned char buf[], size_t size) |
Fill a buffer with random bytes. | |
Random numbers.
|
static |
void random_nonce | ( | unsigned char | buf[], |
size_t | size ) |
Fill a buffer with random bytes.
The bytes are not cryptographically random enough to be used in a key, but they should be good enough for a nonce or boundary string that may be sent in cleartext.
If CONFIG_SSL is defined, then this function is instead defined in src/network/ssl/ssl.c, and it gets random numbers directly from the selected SSL library.
void seed_rand_once | ( | void | ) |