galois.pow¶
- galois.pow(base, exponent, modulus)¶
Efficiently exponentiates an integer \(a^k\ \textrm{mod}\ m\).
The algorithm is more efficient than exponentiating first and then reducing modulo \(m\).
Note
This function is an alias of
pow()
in the standard library.- Parameters
- Returns
The modular exponentiation \(a^k\ \textrm{mod}\ m\).
- Return type
Examples
In [1]: galois.pow(3, 5, 7) Out[1]: 5 In [2]: (3**5) % 7 Out[2]: 5