Function esp_idf_sys::mbedtls_ctr_drbg_set_nonce_len

source ยท
pub unsafe extern "C" fn mbedtls_ctr_drbg_set_nonce_len(
    ctx: *mut mbedtls_ctr_drbg_context,
    len: usize,
) -> c_int
Expand description

\brief This function sets the amount of entropy grabbed as a nonce for the initial seeding.

Call this function before calling mbedtls_ctr_drbg_seed() to read a nonce from the entropy source during the initial seeding.

\param ctx The CTR_DRBG context. \param len The amount of entropy to grab for the nonce, in bytes. This must be at most #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT and at most the maximum length accepted by the entropy function that is set in the context.

\return \c 0 on success. \return #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG if \p len is more than #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT. \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED if the initial seeding has already taken place.