Functions

group group_crypto_lld_rng_functions

Functions

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Prng_Init (CRYPTO_Type *base, uint32_t lfsr32InitState, uint32_t lfsr31InitState, uint32_t lfsr29InitState)

Initializes the PRND parameters.

Invoking this function causes a restart of the pseudo-random sequence.

Parameters
  • base – The pointer to the CRYPTO instance.

  • lfsr32InitState – A non-zero seed value for the first LFSR.

  • lfsr31InitState – A non-zero seed value for the second LFSR.

  • lfsr29InitState – A non-zero seed value for the third LFSR.

Returns

cy_en_crypto_status_t

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Prng (CRYPTO_Type *base, uint32_t max, uint32_t *randomNum)

Generates a Pseudo Random Number.

Parameters
  • base – The pointer to the CRYPTO instance.

  • max – The maximum value of a random number.

  • randomNum – The pointer to a variable to store the generated pseudo random number.

Returns

cy_en_crypto_status_t

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Trng (CRYPTO_Type *base, uint32_t GAROPol, uint32_t FIROPol, uint32_t max, uint32_t *randomNum)

Generates a True Random Number.

Parameters
  • base – The pointer to the CRYPTO instance.

  • GAROPol – The polynomial for the programmable Galois ring oscillator.

  • FIROPol – The polynomial for the programmable Fibonacci ring oscillator.

  • max – The maximum length of a random number, in the range of [0, 32] bits.

  • randomNum – The pointer to a generated true random number. Must be 4-byte aligned.

Returns

cy_en_crypto_status_t