ELinks 0.16.1.1
random.h File Reference

Random numbers. More...

This graph shows which files directly or indirectly include this file:

Functions

void seed_rand_once (void)
void random_nonce (unsigned char buf[], size_t size)
 Fill a buffer with random bytes.

Detailed Description

Random numbers.

Function Documentation

◆ random_nonce()

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.

◆ seed_rand_once()

void seed_rand_once ( void )