Function esp_idf_svc::sys::mbedtls_ecp_check_pub_priv

source ·
pub unsafe extern "C" fn mbedtls_ecp_check_pub_priv(
    pub_: *const mbedtls_ecp_keypair,
    prv: *const mbedtls_ecp_keypair,
    f_rng: Option<unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: usize) -> i32>,
    p_rng: *mut c_void,
) -> i32
Expand description

\brief This function checks that the keypair objects \p pub and \p prv have the same group and the same public point, and that the private key in \p prv is consistent with the public key.

\param pub The keypair structure holding the public key. This must be initialized. If it contains a private key, that part is ignored. \param prv The keypair structure holding the full keypair. This must be initialized. \param f_rng The RNG function. This must not be \c NULL. \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL if \p f_rng doesn’t need a context.

\return \c 0 on success, meaning that the keys are valid and match. \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the keys are invalid or do not match. \return An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX error code on calculation failure.