Montgomery modular exponentiation with a single-word base: r = (a ^ p) mod m.
Declared in <openssl/bn.h>
int
BN_mod_exp_mont_word(
BIGNUM* r,
unsigned long a,
BIGNUM const* p,
BIGNUM const* m,
BN_CTX* ctx,
BN_MONT_CTX* m_ctx);
1 on success, or 0 on error.
| Name | Description |
|---|---|
| r | Destination for the result. |
| a | Word-sized base. |
| p | Exponent. |
| m | Odd modulus. |
| ctx | BN_CTX scratch space. |
| m_ctx | Montgomery context for m, or NULL to build one temporarily. |