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
[in]config

Configuration object of type sl_si91x_trng_config_t

[out]output

Buffer to store the output.

Returns


Definition at line 76 of file components/device/silabs/si91x/wireless/crypto/trng/inc/sl_si91x_trng.h

sl_si91x_trng_entropy#

sl_status_t sl_si91x_trng_entropy (void )

To check the entropy of TRNG and verify its functioning.

Parameters
N/A

Returns


Definition at line 87 of file components/device/silabs/si91x/wireless/crypto/trng/inc/sl_si91x_trng.h

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
[in]trng_key

Pointer to the TRNG key.

[in]key_length

Length of the key in Dwords (uint32_t).

Returns


Definition at line 102 of file components/device/silabs/si91x/wireless/crypto/trng/inc/sl_si91x_trng.h

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
[in]random_number

Address for the random number.

[in]length

Length of the random number in bytes.

Returns


Definition at line 117 of file components/device/silabs/si91x/wireless/crypto/trng/inc/sl_si91x_trng.h

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
[inout]dword

Pointer to the array of elements.

[in]length_in_dwords

Length of the array in dwords.

Returns


Definition at line 133 of file components/device/silabs/si91x/wireless/crypto/trng/inc/sl_si91x_trng.h