Trait snarkvm_wasm::FpParameters[][src]

pub trait FpParameters: 'static + Send + Sync {
    type BigInteger: BigInteger;

    pub const MODULUS: Self::BigInteger;
    pub const MODULUS_BITS: u32;
    pub const REPR_SHAVE_BITS: u32;
    pub const R: Self::BigInteger;
    pub const R2: Self::BigInteger;
    pub const INV: u64;
    pub const GENERATOR: Self::BigInteger;
    pub const CAPACITY: u32;
    pub const TWO_ADICITY: u32;
    pub const ROOT_OF_UNITY: Self::BigInteger;
    pub const T: Self::BigInteger;
    pub const T_MINUS_ONE_DIV_TWO: Self::BigInteger;
    pub const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInteger;
}

A trait that defines parameters for a prime field.

Associated Types

Loading content...

Associated Constants

pub const MODULUS: Self::BigInteger[src]

The modulus of the field.

pub const MODULUS_BITS: u32[src]

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

pub const REPR_SHAVE_BITS: u32[src]

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

pub const R: Self::BigInteger[src]

R = 2^256 % Self::MODULUS

pub const R2: Self::BigInteger[src]

R2 = R^2 % Self::MODULUS

pub const INV: u64[src]

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

pub const GENERATOR: Self::BigInteger[src]

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

pub const CAPACITY: u32[src]

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

pub const TWO_ADICITY: u32[src]

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

pub const ROOT_OF_UNITY: Self::BigInteger[src]

2^s root of unity computed by GENERATOR^t

pub const T: Self::BigInteger[src]

t for 2^s * t = MODULUS - 1

pub const T_MINUS_ONE_DIV_TWO: Self::BigInteger[src]

(t - 1) / 2

pub const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInteger[src]

(Self::MODULUS - 1) / 2

Loading content...

Implementors

impl FpParameters for snarkvm_wasm::FqParameters[src]

impl FpParameters for snarkvm_wasm::FqParameters[src]

impl FpParameters for snarkvm_wasm::FqParameters[src]

type BigInteger = BigInteger256

pub const MODULUS_MINUS_ONE_DIV_TWO: BigInteger256[src]

(r - 1)/2 = 4222230874714185212124412469390773265687949667577031913967616727958704619520

pub const T: BigInteger256[src]

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

pub const T_MINUS_ONE_DIV_TWO: BigInteger256[src]

(t - 1) / 2 = 30000754767301779765804869764101946328252876608481130304309777

impl FpParameters for snarkvm_wasm::FrParameters[src]

impl FpParameters for snarkvm_wasm::FrParameters[src]

impl FpParameters for snarkvm_wasm::FrParameters[src]

type BigInteger = BigInteger256

pub const MODULUS_MINUS_ONE_DIV_TWO: BigInteger256[src]

(r - 1)/2 = 4222230874714185212124412469390773265687949667577031913967616727958704619520

pub const T: BigInteger256[src]

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

pub const T_MINUS_ONE_DIV_TWO: BigInteger256[src]

(t - 1) / 2 = 30000754767301779765804869764101946328252876608481130304309777

Loading content...