Compute modular exponentiation in constant time: rr = (a ^ p) mod m.
Declared in <openssl/bn.h>
int
BN_mod_exp_mont_consttime(
BIGNUM* rr,
BIGNUM const* a,
BIGNUM const* p,
BIGNUM const* m,
BN_CTX* ctx,
BN_MONT_CTX* in_mont);
1 on success, or 0 on error.
| Name | Description |
|---|---|
| rr | Destination for the result. |
| a | Base. |
| p | Exponent (treated as secret for timing purposes). |
| m | Odd modulus. |
| ctx | BN_CTX for temporary storage. |
| in_mont | Optional precomputed Montgomery context for m, or NULL to build one. |