mbedtls_mpi_mod_mul() function
Multiply two residues, returning the residue modulo the specified modulus. The size of the operation is determined by \p N. \p A, \p B and \p X must all be associated with the modulus \p N and must all have the same number of limbs as \p N. \p X may be aliased to \p A or \p B, or even both, but may not overlap either otherwise. They may not alias \p N (since they must be in canonical form, they cannot == \p N).
Arguments
X
The address of the result MPI. Must have the same number of limbs as \p N. On successful completion, \p X contains the result of the multiplication `A * B * R^-1` mod N where `R = 2^(biL * N->limbs)`.
A
The address of the first MPI.
B
The address of the second MPI.
N
The address of the modulus. Used to perform a modulo operation on the result of the multiplication.
Return value
\c 0 if successful. #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if all the parameters do not have the same number of limbs or \p N is invalid. #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
Notes
Currently handles the case when `N->int_rep` is MBEDTLS_MPI_MOD_REP_MONTGOMERY.