BeRTOS
Functions
prng.h File Reference

Generic interface for cryptographically-secure pseudo-RNG. More...

#include <cfg/compiler.h>
#include <cfg/debug.h>

Go to the source code of this file.

Functions

void prng_reseed (PRNG *ctx, const uint8_t *seed)
 Feed a new seed into the PRNG.
size_t prng_seed_len (PRNG *ctx)
 Get the length of the seed in bytes required by this generator.
void prng_generate (PRNG *ctx, uint8_t *data, size_t len)
 Generate some cryptographically-secure random bytes into the specified buffer.

Detailed Description

Generic interface for cryptographically-secure pseudo-RNG.

Author:
Giovanni Bajo <rasky@develer.com>

Definition in file prng.h.


Function Documentation

void prng_reseed ( PRNG *  ctx,
const uint8_t *  seed 
) [inline]

Feed a new seed into the PRNG.

Note:
: Being a cryptographically-secure PRNG, the seed will be mixed to the current state of the generator, so it is NOT possible to generate the same sequence simply by using the same seed. If you need such a property, use a normale PRGN like rand().

Definition at line 60 of file prng.h.