pub trait Field:
Sized
+ Eq
+ Copy
+ Clone
+ Default
+ Send
+ Sync
+ Debug
+ Display
+ Hash
+ 'static
+ Neg<Output = Self>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Sum
+ Product
+ for<'a> Add<&'a Self, Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ for<'a> Mul<&'a Self, Output = Self>
+ for<'a> Sum<&'a Self>
+ for<'a> Product<&'a Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ for<'a> MulAssign<&'a Self>
+ Square
+ InvertOrZero
+ Random
+ WithUnderlier<Underlier: PackScalar<Self>>
+ SerializeBytes
+ DeserializeBytes {
const ZERO: Self;
const ONE: Self;
const CHARACTERISTIC: usize;
// Required method
fn double(&self) -> Self;
// Provided methods
fn is_zero(&self) -> bool { ... }
fn invert(&self) -> Option<Self> { ... }
fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self { ... }
fn pow_vartime<S: AsRef<[u64]>>(&self, exp: S) -> Self { ... }
}Expand description
This trait is based on ff::Field with some unused functionality removed.
Required Associated Constants§
Sourceconst CHARACTERISTIC: usize
const CHARACTERISTIC: usize
The characteristic of the field.
Required Methods§
Provided Methods§
Sourcefn invert(&self) -> Option<Self>
fn invert(&self) -> Option<Self>
Computes the multiplicative inverse of this element, failing if the element is zero.
Sourcefn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self
fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self
Exponentiates self by exp, where exp is a little-endian order integer
exponent.
§Guarantees
This operation is constant time with respect to self, for all exponents with the
same number of digits (exp.as_ref().len()). It is variable time with respect to
the number of digits in the exponent.
Sourcefn pow_vartime<S: AsRef<[u64]>>(&self, exp: S) -> Self
fn pow_vartime<S: AsRef<[u64]>>(&self, exp: S) -> Self
Exponentiates self by exp, where exp is a little-endian order integer
exponent.
§Guarantees
This operation is variable time with respect to self, for all exponent. If
the exponent is fixed, this operation is effectively constant time. However, for
stronger constant-time guarantees, Field::pow should be used.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.