powModOdd

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

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

Parameters

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

Returns

base^exp mod mod