powWithEncodedExponent
Returns x^e (mod m), with the exponent provided as a byte string.
Exponents are usually small, so this function is faster than powPublic as a field element
doesn't have to be created if a serialized representation is already available.
If the exponent is public, powWithEncodedPublicExponent() can be used instead for a slight speedup.
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 powWithEncodedExponent(self: Self, x: Fe, e: []const u8, endian: Endian) NullExponentError!Fe {
return self.powWithEncodedExponentInternal(x, e, endian, false);
}