pow
Returns x^e (mod m) in constant time.
Function parameters
Parameters
An unsigned big integer with a fixed maximum size (`max_bits`), suitable for cryptographic operations.
Functions
Error sets in this namespace
Error Sets
- OverflowError
- Value is too large for the destination.
- InvalidModulusError
- Invalid modulus.
- NullExponentError
- Exponentiation with a null exponent.
- FieldElementError
- Invalid field element for the given modulus.
- RepresentationError
- Invalid representation (Montgomery vs non-Montgomery domain.)
- Error
- The set of all possible errors `std.crypto.ff` functions can return.
Source
Implementation
pub fn pow(self: Self, x: Fe, e: Fe) NullExponentError!Fe {
var buf: [Fe.encoded_bytes]u8 = undefined;
e.toBytes(&buf, native_endian) catch unreachable;
return self.powWithEncodedExponent(x, &buf, native_endian);
}