pub trait _:
FftField<FftParameters = Self::Parameters>
+ PoseidonDefaultField
+ FromStr<Err = FieldError> {
type Parameters: FieldParameters<BigInteger = Self::BigInteger>;
type BigInteger: BigInteger;
const SIZE_IN_BITS: usize = _;
const SIZE_IN_DATA_BITS: usize = _;
// Required methods
fn from_bigint(repr: Self::BigInteger) -> Option<Self>;
fn to_bigint(&self) -> Self::BigInteger;
fn decompose(
&self,
q1: &[u64; 4],
q2: &[u64; 4],
b1: Self,
b2: Self,
r128: Self,
half_r: &[u64; 8],
) -> (Self, Self, bool, bool);
// Provided methods
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.
Provided Associated Constants§
Sourceconst SIZE_IN_BITS: usize = _
const SIZE_IN_BITS: usize = _
Returns the field size in bits.
Sourceconst SIZE_IN_DATA_BITS: usize = _
const SIZE_IN_DATA_BITS: usize = _
Returns the field capacity for data bits.
Required Associated Types§
type Parameters: FieldParameters<BigInteger = Self::BigInteger>
type BigInteger: BigInteger
Required Methods§
Sourcefn from_bigint(repr: Self::BigInteger) -> Option<Self>
fn from_bigint(repr: Self::BigInteger) -> Option<Self>
Constructs a PrimeField
element given a human-readable Self::BigInteger
.
Sourcefn to_bigint(&self) -> Self::BigInteger
fn to_bigint(&self) -> Self::BigInteger
Returns a human-readable Self::BigInteger
in the range 0..(Self::MODULUS - 1)
.
Provided Methods§
Sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
Sourcefn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the capacity size for data bits.
Sourcefn modulus() -> Self::BigInteger
fn modulus() -> Self::BigInteger
Returns the modulus.
Sourcefn modulus_minus_one_div_two() -> Self::BigInteger
fn modulus_minus_one_div_two() -> Self::BigInteger
Returns the modulus minus one divided by two.
Sourcefn trace() -> Self::BigInteger
fn trace() -> Self::BigInteger
Returns the trace.
Sourcefn trace_minus_one_div_two() -> Self::BigInteger
fn trace_minus_one_div_two() -> Self::BigInteger
Returns the trace minus one divided by two.
Sourcefn from_bytes_be_mod_order(bytes: &[u8]) -> Self
fn from_bytes_be_mod_order(bytes: &[u8]) -> Self
Reads bytes in big-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them.
Sourcefn from_bytes_le_mod_order(bytes: &[u8]) -> Self
fn from_bytes_le_mod_order(bytes: &[u8]) -> Self
Reads bytes in little-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them.
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.