Function esp_idf_hal::sys::mbedtls_ecp_muladd
source ยท pub unsafe extern "C" fn mbedtls_ecp_muladd(
grp: *mut mbedtls_ecp_group,
R: *mut mbedtls_ecp_point,
m: *const mbedtls_mpi,
P: *const mbedtls_ecp_point,
n: *const mbedtls_mpi,
Q: *const mbedtls_ecp_point,
) -> i32
Expand description
\brief This function performs multiplication and addition of two points by integers: \p R = \p m * \p P + \p n * \p Q
It is not thread-safe to use same group in multiple threads.
\note In contrast to mbedtls_ecp_mul(), this function does not guarantee a constant execution flow and timing.
\note This function is only defined for short Weierstrass curves. It may not be included in builds without any short Weierstrass curve.
\param grp The ECP group to use. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load(). \param R The point in which to store the result of the calculation. This must be initialized. \param m The integer by which to multiply \p P. This must be initialized. \param P The point to multiply by \p m. This must be initialized. \param n The integer by which to multiply \p Q. This must be initialized. \param Q The point to be multiplied by \p n. This must be initialized.
\return \c 0 on success. \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not valid private keys, or \p P or \p Q are not valid public keys. \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if \p grp does not designate a short Weierstrass curve. \return Another negative error code on other kinds of failure.