Trait mina_curves::pasta::fields::fft::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§
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::BigInt
const R: Self::BigInt
Let M
be the power of 2^64 nearest to Self::MODULUS_BITS
. Then
R = M % Self::MODULUS
.
sourceconst GENERATOR: Self::BigInt
const GENERATOR: Self::BigInt
A multiplicative generator of the field.
Self::GENERATOR
is an element having multiplicative order
Self::MODULUS - 1
.
sourceconst CAPACITY: u32
const CAPACITY: u32
The number of bits that can be reliably stored.
(Should equal SELF::MODULUS_BITS - 1
)
sourceconst T_MINUS_ONE_DIV_TWO: Self::BigInt
const T_MINUS_ONE_DIV_TWO: Self::BigInt
(t - 1) / 2
sourceconst MODULUS_MINUS_ONE_DIV_TWO: Self::BigInt
const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInt
(Self::MODULUS - 1) / 2