mbedtls_psa_get_random() function
The random generator function for the PSA subsystem. This function is suitable as the `f_rng` random generator function parameter of many `mbedtls_xxx` functions. The implementation of this function depends on the configuration of the library.
Arguments
p_rng
This parameter is only kept for backward compatibility reasons with legacy `f_rng` functions and it's ignored. Set to #MBEDTLS_PSA_RANDOM_STATE or NULL.
output
The buffer to fill. It must have room for \c output_size bytes.
output_size
The number of bytes to write to \p output. This function may fail if \p output_size is too large. It is guaranteed to accept any output size requested by Mbed TLS library functions. The maximum request size depends on the library configuration.
Return value
\c 0 on success. An `MBEDTLS_ERR_ENTROPY_xxx`, `MBEDTLS_ERR_PLATFORM_xxx, `MBEDTLS_ERR_CTR_DRBG_xxx` or `MBEDTLS_ERR_HMAC_DRBG_xxx` on error.
Notes
This function may only be used if the PSA crypto subsystem is active. This means that you must call psa_crypto_init() before any call to this function, and you must not call this function after calling mbedtls_psa_crypto_free().
![]()
int mbedtls_psa_get_random(void *p_rng,![]()
int mbedtls_psa_get_random(void *p_rng,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
MBEDTLS_MPI_CHK(mbedtls_mpi_random(&X, 3, &P, mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,![]()
mbedtls_psa_get_random,
mbedtls_psa_get_random() calls 1 function:
![]()
mbedtls_psa_get_random()
mbedtls_psa_get_random() writes 13 variables:
![]()
mbedtls_psa_get_random()