Function esp_idf_sys::mbedtls_md_setup
source ยท pub unsafe extern "C" fn mbedtls_md_setup(
ctx: *mut mbedtls_md_context_t,
md_info: *const mbedtls_md_info_t,
hmac: c_int,
) -> c_int
Expand description
\brief This function selects the message digest algorithm to use, and allocates internal structures.
It should be called after mbedtls_md_init() or
mbedtls_md_free(). Makes it necessary to call
mbedtls_md_free() later.
\param ctx The context to set up. \param md_info The information structure of the message-digest algorithm to use. \param hmac Defines if HMAC is used. 0: HMAC is not used (saves some memory), or non-zero: HMAC is used with this context.
\return \c 0 on success. \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure. \return #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.