mbedtls_psa_crypto_configure_entropy_sources() function
Configure entropy sources. This function may only be called before a call to psa_crypto_init(), or after a call to mbedtls_psa_crypto_free() and before any subsequent call to psa_crypto_init(). This function is only intended for test purposes. The functionality it provides is also useful for system integrators, but system integrators should configure entropy drivers instead of breaking through to the Mbed TLS API.
Arguments
entropy_init
Function to initialize the entropy context and set up the desired entropy sources. It is called by psa_crypto_init(). By default this is mbedtls_entropy_init(). This function cannot report failures directly. To indicate a failure, set the entropy context to a state where mbedtls_entropy_func() will return an error.
entropy_free
Function to free the entropy context and associated resources. It is called by mbedtls_psa_crypto_free(). By default this is mbedtls_entropy_free().
Return value
#PSA_SUCCESS Success. #PSA_ERROR_NOT_PERMITTED The caller does not have the permission to configure entropy sources. #PSA_ERROR_BAD_STATE The library has already been initialized.
mbedtls_psa_crypto_configure_entropy_sources() reads 3 variables and writes 2 variables:
![]()
mbedtls_psa_crypto_configure_entropy_sources()