|
XenevaOS
|
Internal-only bignum public-key cryptosystem API. More...
Go to the source code of this file.
Functions | |
| int | mbedtls_mpi_exp_mod_unsafe (mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *prec_RR) |
| Perform a modular exponentiation: X = A^E mod N. | |
Internal-only bignum public-key cryptosystem API.
This file declares bignum-related functions that are to be used only from within the Mbed TLS library itself.
| int mbedtls_mpi_exp_mod_unsafe | ( | mbedtls_mpi * | X, |
| const mbedtls_mpi * | A, | ||
| const mbedtls_mpi * | E, | ||
| const mbedtls_mpi * | N, | ||
| mbedtls_mpi * | prec_RR | ||
| ) |
Perform a modular exponentiation: X = A^E mod N.
E (the exponent).| X | The destination MPI. This must point to an initialized MPI. This must not alias E or N. |
| A | The base of the exponentiation. This must point to an initialized MPI. |
| E | The exponent MPI. This must point to an initialized MPI. |
| N | The base for the modular reduction. This must point to an initialized MPI. |
| prec_RR | A helper MPI depending solely on N which can be used to speed-up multiple modular exponentiations for the same value of N. This may be NULL. If it is not NULL, it must point to an initialized MPI. If it hasn't been used after the call to mbedtls_mpi_init(), this function will compute the helper value and store it in prec_RR for reuse on subsequent calls to this function. Otherwise, the function will assume that prec_RR holds the helper value set by a previous call to mbedtls_mpi_exp_mod(), and reuse it. |
0 if successful. N is negative or even, or if E is negative.