Trait FieldParameters

Source
pub trait FieldParameters:
    'static
    + FftParameters
    + PoseidonDefaultParameters
    + Copy
    + Clone
    + Debug
    + Default
    + PartialEq
    + Eq
    + Hash {
    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§

Source

const MODULUS: <Self as FftParameters>::BigInteger

The modulus of the field.

Source

const MODULUS_BITS: u32

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

Source

const REPR_SHAVE_BITS: u32

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

Source

const R: <Self as FftParameters>::BigInteger

R = 2^256 % Self::MODULUS

Source

const R2: <Self as FftParameters>::BigInteger

R2 = R^2 % Self::MODULUS

Source

const INV: u64

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

Source

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

Source

const CAPACITY: u32

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

Source

const T: <Self as FftParameters>::BigInteger

t for 2^s * t = MODULUS - 1

Source

const T_MINUS_ONE_DIV_TWO: <Self as FftParameters>::BigInteger

(t - 1) / 2

Source

const MODULUS_MINUS_ONE_DIV_TWO: <Self as FftParameters>::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.

Implementations on Foreign Types§

Source§

impl FieldParameters for FqParameters

Source§

const GENERATOR: BigInteger384

GENERATOR = -5

Source§

const MODULUS: BigInteger384

MODULUS = 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177

Source§

const T: BigInteger384

T = (MODULUS - 1) // 2^S = 3675842578061421676390135839012792950148785745837396071634149488243117337281387659330802195819009059

Source§

const T_MINUS_ONE_DIV_TWO: BigInteger384

(T - 1) // 2 = 1837921289030710838195067919506396475074392872918698035817074744121558668640693829665401097909504529

Source§

const CAPACITY: u32 = 376u32

Source§

const INV: u64 = 9_586_122_913_090_633_727u64

Source§

const MODULUS_BITS: u32 = 377u32

Source§

const MODULUS_MINUS_ONE_DIV_TWO: BigInteger384

Source§

const R: BigInteger384

Source§

const R2: BigInteger384

Source§

const REPR_SHAVE_BITS: u32 = 7u32

Source§

impl FieldParameters for FrParameters

Source§

const GENERATOR: BigInteger256

GENERATOR = 22 Encoded in Montgomery form, so the value is (22 * R) % q = 5642976643016801619665363617888466827793962762719196659561577942948671127251

Source§

const MODULUS: BigInteger256

MODULUS = 8444461749428370424248824938781546531375899335154063827935233455917409239041

Source§

const MODULUS_MINUS_ONE_DIV_TWO: BigInteger256

(r - 1)/2 = 4222230874714185212124412469390773265687949667577031913967616727958704619520

Source§

const T: BigInteger256

t = (r - 1) / 2^s = 60001509534603559531609739528203892656505753216962260608619555

Source§

const T_MINUS_ONE_DIV_TWO: BigInteger256

(t - 1) / 2 = 30000754767301779765804869764101946328252876608481130304309777

Source§

const CAPACITY: u32 = 252u32

Source§

const INV: u64 = 725_501_752_471_715_839u64

Source§

const MODULUS_BITS: u32 = 253u32

Source§

const R: BigInteger256

Source§

const R2: BigInteger256

Source§

const REPR_SHAVE_BITS: u32 = 3u32

Source§

impl FieldParameters for FrParameters

Source§

const GENERATOR: BigInteger256

70865795004005329077606947863872807680085016823885970091001235374859923341923

Source§

const MODULUS: BigInteger256

MODULUS = 2111115437357092606062206234695386632838870926408408195193685246394721360383

Source§

const CAPACITY: u32 = 250u32

Source§

const INV: u64 = 9_659_935_179_256_617_473u64

Source§

const MODULUS_BITS: u32 = 251u32

Source§

const MODULUS_MINUS_ONE_DIV_TWO: BigInteger256

Source§

const R: BigInteger256

Source§

const R2: BigInteger256

Source§

const REPR_SHAVE_BITS: u32 = 5u32

Source§

const T: BigInteger256

Source§

const T_MINUS_ONE_DIV_TWO: BigInteger256

Implementors§