#define TRNG_API_H
@file @copyright Copyright (c) 2020 Silex Insight. All Rights reserved.
The TRNG uses the hardware to generate random number with a high level of entropy. It's intended to feed entropy into a DRBG.
struct sx_trng_config {
In numbers of 128-bit blocks.
Set to 0 to use default. unsigned int wakeup_level;
Set to 0 to use default. unsigned int init_wait;
Set to 0 to use default. unsigned int off_time_delay;
Set to 0 to sample at APB interface clock frequency. unsigned int sample_clock_div; };
typedef int (FUNC_SX_TRNG_INIT)(struct sx_trng ctx, const struct sx_trng_config config); #define SX_TRNG_INIT ((FUNC_SX_TRNG_INIT)((uint32_t )(API_TABLE_BASE_ADDRESS + ATO_SX_TRNG_INIT)))
ctx TRNG context to be used in other operations
config pointer to optional configuration. NULL to use default. @return ::SX_OK @return ::SX_ERR_INCOMPATIBLE_HW
When this function returns ::SX_OK, \p size random bytes have been written to the \p dst memory location. If not enough random bytes are available, the function does not write any data to \p dst and returns ::SX_ERR_INSUFFICIENT.
ctx TRNG context to be used in other operations
dst Destination in memory to copy \p size bytes to
size length in bytes @return ::SX_OK @return ::SX_ERR_INSUFFICIENT @return ::SX_ERR_HARDWARE_FAILURE