mbedtls_mpi_mod_int() function
Perform a modular reduction with respect to an integer. r = A mod b
Arguments
r
The address at which to store the residue. This must not be \c NULL.
A
The MPI to compute the residue of. This must point to an initialized MPi.
b
The integer base of the modular reduction.
Return value
\c 0 if successful. #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p b equals zero. #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p b is negative. Another negative error code on different kinds of failure.