Function esp_idf_svc::sys::mbedtls_ecp_check_pubkey
source ยท pub unsafe extern "C" fn mbedtls_ecp_check_pubkey(
grp: *const mbedtls_ecp_group,
pt: *const mbedtls_ecp_point,
) -> i32
Expand description
\brief This function checks that a point is a valid public key on this curve.
It only checks that the point is non-zero, has
valid coordinates and lies on the curve. It does not verify
that it is indeed a multiple of \c G. This additional
check is computationally more expensive, is not required
by standards, and should not be necessary if the group
used has a small cofactor. In particular, it is useless for
the NIST groups which all have a cofactor of 1.
\note This function uses bare components rather than an ::mbedtls_ecp_keypair structure, to ease use with other structures, such as ::mbedtls_ecdh_context or ::mbedtls_ecdsa_context.
\param grp The ECP group the point should belong to. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load(). \param pt The point to check. This must be initialized.
\return \c 0 if the point is a valid public key. \return #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not a valid public key for the given curve. \return Another negative error code on other kinds of failure.