PSoC64 Secure Boot Utilities Middleware Library 1.0
Random generation

General Description

Functions

cy_p64_psa_status_t cy_p64_psa_generate_random (uint8_t *output, size_t output_size)
 Generates random bytes. More...
 

Function Documentation

◆ cy_p64_psa_generate_random()

cy_p64_psa_status_t cy_p64_psa_generate_random ( uint8_t *  output,
size_t  output_size 
)

Generates random bytes.

Warning
This function can fail! Callers MUST check the return status and MUST NOT use the content of the output buffer if the return status is not CY_P64_PSA_SUCCESS.
Note
To generate a key, use cy_p64_psa_generate_key() instead.
Parameters
[out]outputThe output buffer for the generated data.
output_sizeThe number of bytes to generate and output.
Return values
CY_P64_PSA_SUCCESS
CY_P64_PSA_ERROR_NOT_SUPPORTED
CY_P64_PSA_ERROR_INSUFFICIENT_ENTROPY
CY_P64_PSA_ERROR_INSUFFICIENT_MEMORY
CY_P64_PSA_ERROR_COMMUNICATION_FAILURE
CY_P64_PSA_ERROR_HARDWARE_FAILURE
CY_P64_PSA_ERROR_CORRUPTION_DETECTED
CY_P64_PSA_ERROR_BAD_STATEIt is implementation-dependent whether initialize results fails in this error code.