pub trait PrimeField: Field {
const NUM_BITS: u32;
const CAPACITY: u32;
// Required methods
fn into_repr(self) -> Vec<u64>;
fn from_repr(_: &[u64]) -> Result<Self, CurveDecodingError>;
}Expand description
This is an extension of the Field trait that adds some constants decribing
the element size and operations for converting to/from big integer
representation (an array of u64 limbs.)
Required Associated Constants§
Sourceconst CAPACITY: u32
const CAPACITY: u32
How many bits of information can be reliably stored in the field
element. It is expected that num_limbs * 64 - CAPACITY < 64, where
num_limbs is the size of vector returned by
PrimeField::into_repr.
Required Methods§
Sourcefn into_repr(self) -> Vec<u64>
fn into_repr(self) -> Vec<u64>
Get a big integer representation with least significant digit first.
Sourcefn from_repr(_: &[u64]) -> Result<Self, CurveDecodingError>
fn from_repr(_: &[u64]) -> Result<Self, CurveDecodingError>
Get a prime field element from its big integer representaion (least significant digit first).
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<F> PrimeField for ArkField<F>where
F: PrimeField,
A blanket implementation of the PrimeField trait using the functionality
of ark_ff::PrimeField. This gives an implementation of our PrimeField
trait for ArkField<F> for any F that implements ark_ff::PrimeField.
impl<F> PrimeField for ArkField<F>where
F: PrimeField,
A blanket implementation of the PrimeField trait using the functionality
of ark_ff::PrimeField. This gives an implementation of our PrimeField
trait for ArkField<F> for any F that implements ark_ff::PrimeField.