Trait snarkvm_wasm::FieldParameters
source · pub trait FieldParameters: 'static + FftParameters + PoseidonDefaultParameters {
const MODULUS: <Self as FftParameters>::BigInteger;
const MODULUS_BITS: u32;
const REPR_SHAVE_BITS: u32;
const R: <Self as FftParameters>::BigInteger;
const R2: <Self as FftParameters>::BigInteger;
const INV: u64;
const GENERATOR: <Self as FftParameters>::BigInteger;
const CAPACITY: u32;
const T: <Self as FftParameters>::BigInteger;
const T_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger;
const MODULUS_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger;
}Expand description
A trait that defines parameters for a prime field.
Required Associated Constants
sourceconst MODULUS: <Self as FftParameters>::BigInteger
const MODULUS: <Self as FftParameters>::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 as FftParameters>::BigInteger
const R: <Self as FftParameters>::BigInteger
R = 2^256 % Self::MODULUS
sourceconst R2: <Self as FftParameters>::BigInteger
const R2: <Self as FftParameters>::BigInteger
R2 = R^2 % Self::MODULUS
sourceconst GENERATOR: <Self as FftParameters>::BigInteger
const GENERATOR: <Self as FftParameters>::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 as FftParameters>::BigInteger
const T: <Self as FftParameters>::BigInteger
t for 2^s * t = MODULUS - 1
sourceconst T_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger
const T_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger
(t - 1) / 2
sourceconst MODULUS_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger
const MODULUS_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger
(Self::MODULUS - 1) / 2
Implementations on Foreign Types
sourceimpl FieldParameters for FrParameters
impl FieldParameters for FrParameters
sourceconst GENERATOR: BigInteger256 = BigInteger([11289572479685143826u64, 11383637369941080925u64,
2288212753973340071u64, 82014976407880291u64])
const GENERATOR: BigInteger256 = BigInteger([11289572479685143826u64, 11383637369941080925u64, 2288212753973340071u64, 82014976407880291u64])
70865795004005329077606947863872807680085016823885970091001235374859923341923
sourceconst MODULUS: BigInteger256 = BigInteger([13356249993388743167u64, 5950279507993463550u64,
10965441865914903552u64, 336320092672043349u64])
const MODULUS: BigInteger256 = BigInteger([13356249993388743167u64, 5950279507993463550u64, 10965441865914903552u64, 336320092672043349u64])
MODULUS = 2111115437357092606062206234695386632838870926408408195193685246394721360383