galois.pow¶
- class galois.pow(base, exp, mod)¶
Efficiently exponentiates an integer \(a^k (\textrm{mod}\ m)\).
The algorithm is more efficient than exponentiating first and then reducing modulo \(m\). This is the integer equivalent of
galois.poly_pow()
.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 [606]: galois.pow(3, 5, 7) Out[606]: 5 In [607]: (3**5) % 7 Out[607]: 5