powModOdd

fnBigInt powModOdd(BigInt base, BigInt exp, BigInt mod)

Computes modular exponentiation for odd modulus using sliding window binary exponentiation with regular modular reduction.

Security: NOT constant-time - see powMod. The exponent must be treated as public, or blinded, whenever it is secret.

Parameters

baseThe base value
expThe exponent
modThe modulus (must be odd and positive)

Returns

base^exp mod mod