mbedtls_mpi_core_sub() function
Subtract two fixed-size large unsigned integers, returning the borrow. Calculate `A - B` where \p A and \p B have the same size. This function operates modulo `2^(biL*limbs)` and returns the carry (1 if there was a wraparound, i.e. if `A < B`, and 0 otherwise). \p X may be aliased to \p A or \p B, or even both, but may not overlap either otherwise.
Arguments
X
The result of the subtraction.
A
Little-endian presentation of left operand.
B
Little-endian presentation of right operand.
limbs
Number of limbs of \p X, \p A and \p B.
Return value
1 if `A < B`. 0 if `A >= B`.
![]()
carry = mbedtls_mpi_core_sub(X->p, A->p, B->p, n);
mbedtls_mpi_core_sub() is called by 2 functions:
![]()
mbedtls_mpi_core_sub()
mbedtls_mpi_core_sub():
![]()
mbedtls_mpi_core_sub()