Trait FpParameters

Source
pub trait FpParameters: FftParameters {
    const MODULUS: Self::BigInt;
    const MODULUS_BITS: u32;
    const REPR_SHAVE_BITS: u32;
    const R: Self::BigInt;
    const R2: Self::BigInt;
    const INV: u64;
    const GENERATOR: Self::BigInt;
    const CAPACITY: u32;
    const T: Self::BigInt;
    const T_MINUS_ONE_DIV_TWO: Self::BigInt;
    const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInt;
}
Expand description

A trait that defines parameters for a prime field.

Required Associated Constants§

Source

const MODULUS: Self::BigInt

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::BigInt

Let M be the power of 2^64 nearest to Self::MODULUS_BITS. Then R = M % Self::MODULUS.

Source

const R2: Self::BigInt

R2 = R^2 % Self::MODULUS

Source

const INV: u64

INV = -MODULUS^{-1} mod 2^64

Source

const GENERATOR: Self::BigInt

A multiplicative generator of the field. Self::GENERATOR is an element having multiplicative order Self::MODULUS - 1.

Source

const CAPACITY: u32

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

Source

const T: Self::BigInt

t for 2^s * t = MODULUS - 1, and t coprime to 2.

Source

const T_MINUS_ONE_DIV_TWO: Self::BigInt

(t - 1) / 2

Source

const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInt

(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.

Implementors§

Source§

impl FpParameters for FpParameters

Source§

const MODULUS: BigInteger

Source§

const R: BigInteger

Source§

const R2: BigInteger

Source§

const MODULUS_MINUS_ONE_DIV_TWO: BigInteger

Source§

const T: BigInteger

Source§

const T_MINUS_ONE_DIV_TWO: BigInteger

Source§

const GENERATOR: BigInteger

Source§

const MODULUS_BITS: u32 = 255u32

Source§

const CAPACITY: u32 = 254u32

Source§

const REPR_SHAVE_BITS: u32 = 1u32

Source§

const INV: u64 = 11_037_532_056_220_336_127u64

Source§

impl FpParameters for FqParameters

Source§

const MODULUS: BigInteger

Source§

const R: BigInteger

Source§

const R2: BigInteger

Source§

const MODULUS_MINUS_ONE_DIV_TWO: BigInteger

Source§

const T: BigInteger

Source§

const T_MINUS_ONE_DIV_TWO: BigInteger

Source§

const GENERATOR: BigInteger

Source§

const MODULUS_BITS: u32 = 255u32

Source§

const CAPACITY: u32 = 254u32

Source§

const REPR_SHAVE_BITS: u32 = 1u32

Source§

const INV: u64 = 10_108_024_940_646_105_087u64