pub trait FieldParameters:
'static
+ FftParameters
+ PoseidonDefaultParameters
+ Copy
+ Clone
+ Debug
+ Default
+ PartialEq
+ Eq
+ Hash {
const MODULUS: Self::BigInteger;
const MODULUS_BITS: u32;
const REPR_SHAVE_BITS: u32;
const R: Self::BigInteger;
const R2: Self::BigInteger;
const INV: u64;
const GENERATOR: Self::BigInteger;
const CAPACITY: u32;
const T: Self::BigInteger;
const T_MINUS_ONE_DIV_TWO: Self::BigInteger;
const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInteger;
}
Expand description
A trait that defines parameters for a prime field.
Required Associated Constants§
Sourceconst MODULUS: Self::BigInteger
const MODULUS: Self::BigInteger
The modulus of the field.
Sourceconst MODULUS_BITS: u32
const MODULUS_BITS: u32
The number of bits needed to represent the Self::MODULUS
.
Sourceconst REPR_SHAVE_BITS: u32
const REPR_SHAVE_BITS: u32
The number of bits that must be shaved from the beginning of the representation when randomly sampling.
Sourceconst R: Self::BigInteger
const R: Self::BigInteger
R = 2^256 % Self::MODULUS
Sourceconst R2: Self::BigInteger
const R2: Self::BigInteger
R2 = R^2 % Self::MODULUS
Sourceconst GENERATOR: Self::BigInteger
const GENERATOR: Self::BigInteger
A multiplicative generator that is also a quadratic nonresidue.
Self::GENERATOR
is an element having multiplicative order
Self::MODULUS - 1
.
There also does not exist x
such that Self::GENERATOR = x^2 % Self::MODULUS
Sourceconst CAPACITY: u32
const CAPACITY: u32
The number of bits that can be reliably stored.
(Should equal SELF::MODULUS_BITS - 1
)
Sourceconst T: Self::BigInteger
const T: Self::BigInteger
t for 2^s * t = MODULUS - 1
Sourceconst T_MINUS_ONE_DIV_TWO: Self::BigInteger
const T_MINUS_ONE_DIV_TWO: Self::BigInteger
(t - 1) / 2
Sourceconst MODULUS_MINUS_ONE_DIV_TWO: Self::BigInteger
const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInteger
(Self::MODULUS - 1) / 2
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.