Trait snarkvm_fields::FieldParameters[][src]

pub trait FieldParameters: 'static + Send + Sync + Sized {
    type BigInteger: BigInteger;
Show associated constants and methods 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 TWO_ADICITY: u32; const ROOT_OF_UNITY: Self::BigInteger; 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.

Associated Types

Associated Constants

The modulus of the field.

The number of bits needed to represent the Self::MODULUS.

The number of bits that must be shaved from the beginning of the representation when randomly sampling.

R = 2^256 % Self::MODULUS

R2 = R^2 % Self::MODULUS

INV = -(MODULUS^{-1} mod MODULUS) mod MODULUS

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

The number of bits that can be reliably stored. (Should equal SELF::MODULUS_BITS - 1)

2^s * t = MODULUS - 1 with t odd. This is the two-adicity of the prime.

2^s root of unity computed by GENERATOR^t

t for 2^s * t = MODULUS - 1

(t - 1) / 2

(Self::MODULUS - 1) / 2

Implementors