PSoC 6 Peripheral Driver Library

General Description

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. More...
 
__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. More...
 
__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. More...
 

Function Documentation

◆ Cy_Crypto_Core_Prng_Init()

__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
baseThe pointer to the CRYPTO instance.
lfsr32InitStateA non-zero seed value for the first LFSR.
lfsr31InitStateA non-zero seed value for the second LFSR.
lfsr29InitStateA non-zero seed value for the third LFSR.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Prng()

__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
baseThe pointer to the CRYPTO instance.
maxThe maximum value of a random number.
randomNumThe pointer to a variable to store the generated pseudo random number.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Trng()

__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
baseThe pointer to the CRYPTO instance.
GAROPolThe polynomial for the programmable Galois ring oscillator.
FIROPolThe polynomial for the programmable Fibonacci ring oscillator.
maxThe maximum length of a random number, in the range of [0, 32] bits.
randomNumThe pointer to a generated true random number. Must be 4-byte aligned.
Returns
cy_en_crypto_status_t