BeRTOS
random.h File Reference

High-level random number generation functions. More...

#include "cfg/cfg_random.h"
#include <cfg/compiler.h>

Go to the source code of this file.

Defines

Security level definition

Configure the security level required by the application.

Application developers are suggested to keep the strongest setting (default) unless there are memory or code size issues.

Available settings are:

* RANDOM_SECURITY_STRONG: The random library will use an entropy pool, automatically feeded by drivers, to gather entropy from hardware sources. Data from the pool will be used to reseed a secure random number generator. Moreover, the generator will be automatically initialised with enough entropy to generate safe random numbers even immediately after hw reset. The overall structure is the same as used by modern desktop PCs for generating secure random numbers.

* RANDOM_SECURITY_MEDIUM: This intermediate settings will avoid usage of an entropy pool, to reduce memory and code usage. The security of this settings relies only on the good behaviour of the random number generator (even though it will be well-seeded at startup).

* RANDOM_SECURITY_MINIMUM: This is the lighter setting that allows minimal memory and code usage, and it suggested only for extremely constrained systems, that only generates few random numbers. Even if the generator is still secure on paper, its seeding will not be safe (though still entropic to allow different sequences to be generated after each reset).

#define RANDOM_SECURITY_MINIMUM   0
#define RANDOM_SECURITY_MEDIUM   1
#define RANDOM_SECURITY_STRONG   2

Detailed Description

High-level random number generation functions.

Author:
Giovanni Bajo <rasky@develer.com>

Definition in file random.h.