SmartSnippets DA1459x SDK
Macros | Enumerations | Functions
True Random Number Generator

Random number generation. More...

Macros

#define SYS_TRNG_SEED_SIZE   (IRNG_RANDOM_SEED_SIZE_BYTES)
 The size of TRNG seed in bytes.
 
#define SYS_TRNG_MEMORY_BLOCKS   (IRNG_MINIMUM_SRAM_PUF_BLOCKS + 4)
 The number of memory blocks passed as entropy source. The size of the block is 16 bytes, as defined by IRNG_BLOCK_SIZE_BYTES.
 

Enumerations

enum  SYS_TRNG_ERROR
 SYS_TRNG error codes.
 

Functions

bool sys_trng_can_run (void)
 Checks whether the TRNG module can generate a seed or not. More...
 
SYS_TRNG_ERROR sys_trng_init (void)
 Runs a software algorithm which generates a random seed. Random memory data are used to feed the software algorithm. More...
 

Detailed Description

Random number generation.

Function Documentation

◆ sys_trng_can_run()

bool sys_trng_can_run ( void  )

Checks whether the TRNG module can generate a seed or not.

Returns
if true the sys_trng_init() can be called, otherwise not.

◆ sys_trng_init()

SYS_TRNG_ERROR sys_trng_init ( void  )

Runs a software algorithm which generates a random seed. Random memory data are used to feed the software algorithm.

Note
It must be ensured that random memory data (it is assumed that a RAM cell contains random values when it powers-up) are fed to the software algorithm, otherwise the sys_trng_init() will return an error code. The sys_trng_can_run() assures that the software algorithm will be fed with random data.
Returns
error code. SYS_TRNG_ERROR_NONE if the seed was successfully generated, otherwise an error code.