Function esp_idf_svc::sys::mbedtls_md_clone

source ยท
pub unsafe extern "C" fn mbedtls_md_clone(
    dst: *mut mbedtls_md_context_t,
    src: *const mbedtls_md_context_t,
) -> i32
Expand description

\brief This function clones the state of a message-digest context.

\note You must call mbedtls_md_setup() on \c dst before calling this function.

\note The two contexts must have the same type, for example, both are SHA-256.

\warning This function clones the message-digest state, not the HMAC state.

\param dst The destination context. \param src The context to be cloned.

\return \c 0 on success. \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure. \return #MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE if both contexts are not using the same engine. This can be avoided by moving the call to psa_crypto_init() before the first call to mbedtls_md_setup().