Function esp_idf_svc::hal::sys::mbedtls_rsa_pkcs1_verify

source ยท
pub unsafe extern "C" fn mbedtls_rsa_pkcs1_verify(
    ctx: *mut mbedtls_rsa_context,
    md_alg: u32,
    hashlen: u32,
    hash: *const u8,
    sig: *const u8,
) -> i32
Expand description

\brief This function performs a public RSA operation and checks the message digest.

            This is the generic wrapper for performing a PKCS#1
            verification.

\note For PKCS#1 v2.1 encoding, see comments on mbedtls_rsa_rsassa_pss_verify() about \c md_alg and \c hash_id.

\param ctx The initialized RSA public key context to use. \param md_alg The message-digest algorithm used to hash the original data. Use #MBEDTLS_MD_NONE for signing raw data. \param hashlen The length of the message digest or raw data in Bytes. If \p md_alg is not #MBEDTLS_MD_NONE, this must match the output length of the corresponding hash algorithm. \param hash The buffer holding the message digest or raw data. This must be a readable buffer of at least \p hashlen Bytes. \param sig The buffer holding the signature. This must be a readable buffer of length \c ctx->len Bytes. For example, \c 256 Bytes for an 2048-bit RSA modulus.

\return \c 0 if the verify operation was successful. \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.