galois.modular_exp

galois.modular_exp(base, exponent, modulus)[source]

Compute the modular exponentiation \(base^exponent \textrm{mod}\ modulus\).

Parameters
  • base (array_like) – The base of exponential, an int or an array (follows numpy broadcasting rules).

  • exponent (array_like) – The exponent, an int or an array (follows numpy broadcasting rules).

  • modulus (array_like) – The modulus of the computation, an int or an array (follows numpy broadcasting rules).

Returns

The results of \(base^exponent \textrm{mod}\ modulus\).

Return type

array_like