SmartSnippets DA1459x SDK
Enumerations | Functions
Deterministic Random Bit Generator

Deterministic random bit generator. More...

Enumerations

enum  SYS_DRBG_ERROR { SYS_DRBG_ERROR_NONE = 0, SYS_DRBG_ERROR_BUFFER_EXHAUSTED = -1 }
 sys drbg errors More...
 

Functions

void sys_drbg_srand (void)
 Set the seed for the random number generator function.
 
void sys_drbg_init (void)
 Initializes the DRBG data structure. More...
 
SYS_DRBG_ERROR sys_drbg_read_rand (uint32_t *rand_number)
 Reads a random number from the buffer which holds the random numbers. More...
 
void sys_drbg_update (void)
 Updates the DRBG data structure. More...
 
uint32_t sys_drbg_read_index (void)
 Reads the current index value of the buffer. More...
 
uint32_t sys_drbg_read_threshold (void)
 Reads the threshold level value. More...
 
uint8_t sys_drbg_read_request (void)
 Reads the request value. More...
 

Detailed Description

Deterministic random bit generator.

Enumeration Type Documentation

◆ SYS_DRBG_ERROR

sys drbg errors

Enumerator
SYS_DRBG_ERROR_NONE 

no error

SYS_DRBG_ERROR_BUFFER_EXHAUSTED 

buffer with random numbers has been exhausted

Function Documentation

◆ sys_drbg_init()

void sys_drbg_init ( void  )

Initializes the DRBG data structure.

See also
sys_drbg_t

◆ sys_drbg_read_index()

uint32_t sys_drbg_read_index ( void  )

Reads the current index value of the buffer.

Returns
The current index value of the buffer

◆ sys_drbg_read_rand()

SYS_DRBG_ERROR sys_drbg_read_rand ( uint32_t *  rand_number)

Reads a random number from the buffer which holds the random numbers.

Note
When a random number is read from the buffer it is assumed to be consumed. The next time the sys_drbg_read_rand() will be called a new random number will be read from the buffer.
Parameters
[out]rand_numberThe random number to be returned
Returns
Error code. If 0 the random number was successfully read, otherwise not.

◆ sys_drbg_read_request()

uint8_t sys_drbg_read_request ( void  )

Reads the request value.

Returns
Either 0 or 1. If the request value is 1, there is a pending request for buffer update.

◆ sys_drbg_read_threshold()

uint32_t sys_drbg_read_threshold ( void  )

Reads the threshold level value.

Note
If the buffer's current index is equal to the threshold level value or greater than the threshold level value, then a request for buffer update will be issued.
Returns
The threshold level value

◆ sys_drbg_update()

void sys_drbg_update ( void  )

Updates the DRBG data structure.

See also
sys_drbg_t