mbedtls_mpi_core_from_mont_rep() function
Convert an MPI from Montgomery form. \p X may be aliased to \p A, but may not otherwise overlap it. \p X may not alias \p N (it is in canonical form, so must be strictly less than \p N). This function is a thin wrapper around `mbedtls_mpi_core_montmul()` that is an alternative to calling `mbedtls_mpi_mod_raw_from_mont_rep()` when we don't want to allocate memory.
Arguments
X
The result of the conversion. Must have the same number of limbs as \p A.
A
The MPI to convert from Montgomery form. Must have the same number of limbs as the modulus.
N
The address of the modulus, which gives the size of the base `R` = 2^(biL*N->limbs).
AN_limbs
The number of limbs in \p X, \p A and \p N.
mm
The Montgomery constant for \p N: -N^-1 mod 2^biL. This can be determined by calling `mbedtls_mpi_core_montmul_init()`.
T
Temporary storage of size at least `mbedtls_mpi_core_montmul_working_limbs(AN_limbs)` limbs. Its initial content is unused and its final content is indeterminate. It must not alias or otherwise overlap any of the other parameters.
![]()
mbedtls_mpi_core_from_mont_rep(X->p, X->p, N->p, N->n, mm, T);
mbedtls_mpi_core_from_mont_rep() is called by 1 function and calls 1 function:
![]()
mbedtls_mpi_core_from_mont_rep()
mbedtls_mpi_core_from_mont_rep():
![]()
mbedtls_mpi_core_from_mont_rep()