Trait ff::PrimeField
[−]
[src]
pub trait PrimeField: Field { type Repr: PrimeFieldRepr; fn from_repr(_: Self::Repr) -> Result<Self, ()>; fn into_repr(&self) -> Self::Repr; fn char() -> Self::Repr; fn num_bits() -> u32; fn capacity() -> u32; fn multiplicative_generator() -> Self; fn s() -> usize; fn root_of_unity() -> Self; }
This represents an element of a prime field.
Associated Types
type Repr: PrimeFieldRepr
The prime field can be converted back and forth into this biginteger representation.
Required Methods
fn from_repr(_: Self::Repr) -> Result<Self, ()>
Convert this prime field element into a biginteger representation.
fn into_repr(&self) -> Self::Repr
Convert a biginteger reprensentation into a prime field element, if the number is an element of the field.
fn char() -> Self::Repr
Returns the field characteristic; the modulus.
fn num_bits() -> u32
Returns how many bits are needed to represent an element of this field.
fn capacity() -> u32
Returns how many bits of information can be reliably stored in the field element.
fn multiplicative_generator() -> Self
Returns the multiplicative generator of char()
- 1 order. This element
must also be quadratic nonresidue.
fn s() -> usize
Returns s such that 2s * t = char()
- 1 with t odd.
fn root_of_unity() -> Self
Returns the 2s root of unity computed by exponentiating the multiplicative_generator()
by t.