Function esp_idf_hal::sys::mbedtls_ecdsa_read_signature_restartable
source ยท pub unsafe extern "C" fn mbedtls_ecdsa_read_signature_restartable(
ctx: *mut mbedtls_ecp_keypair,
hash: *const u8,
hlen: usize,
sig: *const u8,
slen: usize,
rs_ctx: *mut c_void,
) -> i32
Expand description
\brief This function reads and verifies an ECDSA signature, in a restartable way.
\see \c mbedtls_ecdsa_read_signature()
\note This function is like \c mbedtls_ecdsa_read_signature() but it can return early and restart according to the limit set with \c mbedtls_ecp_set_max_ops() to reduce blocking.
\param ctx The ECDSA context to use. This must be initialized and have a group and public key bound to it. \param hash The message hash that was signed. This must be a readable buffer of length \p hlen Bytes. \param hlen The size of the hash \p hash. \param sig The signature to read and verify. This must be a readable buffer of length \p slen Bytes. \param slen The size of \p sig in Bytes. \param rs_ctx The restart context to use. This may be \c NULL to disable restarting. If it is not \c NULL, it must point to an initialized restart context.
\return \c 0 on success. \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid. \return #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid signature in \p sig, but its length is less than \p siglen. \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of operations was reached: see \c mbedtls_ecp_set_max_ops(). \return Another \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX error code on failure for any other reason.