pub trait PrimeField: FftField<FftParameters = Self::Parameters> + PoseidonDefaultField + FromStr<Err = FieldError> {
    type Parameters: FieldParameters
    where
        <Self::Parameters as FftParameters>::BigInteger == Self::BigInteger
; type BigInteger: BigInteger; const SIZE_IN_BITS: usize = ; const SIZE_IN_DATA_BITS: usize = ; fn from_repr(repr: Self::BigInteger) -> Option<Self>; fn to_repr(&self) -> Self::BigInteger; fn to_repr_unchecked(&self) -> Self::BigInteger; fn size_in_bits() -> usize { ... } fn size_in_data_bits() -> usize { ... } fn modulus() -> Self::BigInteger { ... } fn modulus_minus_one_div_two() -> Self::BigInteger { ... } fn trace() -> Self::BigInteger { ... } fn trace_minus_one_div_two() -> Self::BigInteger { ... } fn from_bytes_be_mod_order(bytes: &[u8]) -> Self { ... } fn from_bytes_le_mod_order(bytes: &[u8]) -> Self { ... } }
Expand description

The interface for a prime field.

Required Associated Types

Provided Associated Constants

Returns the field size in bits.

Returns the field capacity for data bits.

Required Methods

Returns a prime field element from its underlying representation.

Returns the underlying representation of the prime field element.

Returns the underlying raw representation of the prime field element.

Provided Methods

Returns the field size in bits.

Returns the capacity size for data bits.

Returns the modulus.

Returns the modulus minus one divided by two.

Returns the trace.

Returns the trace minus one divided by two.

Reads bytes in big-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them.

Reads bytes in little-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them.

Implementors