Functions | |
| __STATIC_INLINE cy_en_crypto_status_t | Cy_Crypto_Prng_Init (CRYPTO_Type *base, uint32_t *lfsrSeedValues) |
| This function initializes the PRNG (Pseudo Random Number Generator) parameters. More... | |
| __STATIC_INLINE cy_en_crypto_status_t | Cy_Crypto_Prng (CRYPTO_Type *base, uint32_t max, uint32_t *randomNum) |
| This function generates a Pseudo Random Number based on the initial seed values provided in Cy_Crypto_Prng_Init(). More... | |
| cy_en_crypto_status_t | Cy_Crypto_Trng (CRYPTO_Type *base, uint32_t max, uint32_t *randomNum) |
| This function generates a True Random Number. More... | |
| __STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Prng_Init | ( | CRYPTO_Type * | base, |
| uint32_t * | lfsrSeedValues | ||
| ) |
This function initializes the PRNG (Pseudo Random Number Generator) parameters.
Invoking this function causes a restart of the pseudo-random sequence.
| base | Base address of the Crypto block registers |
| lfsrSeedValues | Pointer to an array of three seed values for the Linear Feedback Shift Registers - LFSR32, LFSR31 and LFSR29 respectively. Each seed value must be a non-zero, random number. Passing NULL will cause seed values to be generated internally, using the Cy_Crypto_Trng() function. In this case, ensure that Cy_Crypto_Trng() is not called from another thread until the this function returns. |
| __STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Prng | ( | CRYPTO_Type * | base, |
| uint32_t | max, | ||
| uint32_t * | randomNum | ||
| ) |
This function generates a Pseudo Random Number based on the initial seed values provided in Cy_Crypto_Prng_Init().
| base | Base address of the Crypto block registers |
| max | Maximum value of the generated pseudo random number. The range of the pseudo random number generated is [0, max]. The max value can be any integer between 1 and 232 - 1 (1 to 4294967295). |
| randomNum | Pointer to the generated pseudo random number. This must be a pointer to a 32-bit number. |
| cy_en_crypto_status_t Cy_Crypto_Trng | ( | CRYPTO_Type * | base, |
| uint32_t | max, | ||
| uint32_t * | randomNum | ||
| ) |
This function generates a True Random Number.
| base | Base address of the Crypto block registers |
| max | Maximum length of a random number, in the range of [1, 32] bits. The generated random number is in the range of [1, 2max]. |
| randomNum | Pointer to the generated true random number. This must be a pointer to a 32-bit number. |