mbedtls_ecp_muladd() function
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.
Arguments
grp
The ECP group to use. This must be initialized and have group parameters set, for example through mbedtls_ecp_group_load().
R
The point in which to store the result of the calculation. This must be initialized.
m
The integer by which to multiply \p P. This must be initialized.
P
The point to multiply by \p m. This must be initialized.
n
The integer by which to multiply \p Q. This must be initialized.
Q
The point to be multiplied by \p n. This must be initialized.
Return value
\c 0 on success. #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. #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. Another negative error code on other kinds of failure.
Notes
In contrast to mbedtls_ecp_mul(), this function does not guarantee a constant execution flow and timing.