Functions#

This section provides a reference to the TRNG Crypto API functions.

Functions#

sl_status_t
sl_si91x_trng_init(sl_si91x_trng_config_t *config, uint32_t *output)

To initialize the TRNG hardware engine.

sl_status_t

To check the entropy of TRNG and verify its functioning.

sl_status_t
sl_si91x_trng_program_key(uint32_t *trng_key, uint16_t key_length)

To initialize and program the key required for the TRNG hardware engine.

sl_status_t
sl_si91x_trng_get_random_num(uint32_t *random_number, uint16_t length)

To generate a random number of the desired length.

sl_status_t
sl_si91x_duplicate_element(uint32_t *dword, uint32_t length_in_dwords)

To check if there are any repeating elements in the array.

Function Documentation#

sl_si91x_trng_init#

sl_status_t sl_si91x_trng_init (sl_si91x_trng_config_t * config, uint32_t * output)

To initialize the TRNG hardware engine.

Parameters
TypeDirectionArgument NameDescription
sl_si91x_trng_config_t *[in]config

Configuration object of type sl_si91x_trng_config_t

uint32_t *[out]output

Buffer to store the output.

Returns


sl_si91x_trng_entropy#

sl_status_t sl_si91x_trng_entropy (void )

To check the entropy of TRNG and verify its functioning.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns


sl_si91x_trng_program_key#

sl_status_t sl_si91x_trng_program_key (uint32_t * trng_key, uint16_t key_length)

To initialize and program the key required for the TRNG hardware engine.

Parameters
TypeDirectionArgument NameDescription
uint32_t *[in]trng_key

Pointer to the TRNG key.

uint16_t[in]key_length

Length of the key in Dwords (uint32_t).

Returns


sl_si91x_trng_get_random_num#

sl_status_t sl_si91x_trng_get_random_num (uint32_t * random_number, uint16_t length)

To generate a random number of the desired length.

Parameters
TypeDirectionArgument NameDescription
uint32_t *[in]random_number

Address for the random number.

uint16_t[in]length

Length of the random number in bytes.

Returns


sl_si91x_duplicate_element#

sl_status_t sl_si91x_duplicate_element (uint32_t * dword, uint32_t length_in_dwords)

To check if there are any repeating elements in the array.

Parameters
TypeDirectionArgument NameDescription
uint32_t *[inout]dword

Pointer to the array of elements.

uint32_t[in]length_in_dwords

Length of the array in dwords.

Returns