FieldParameters

Trait FieldParameters 

Source
pub trait FieldParameters:
    Send
    + Sync
    + Copy
    + 'static
    + Debug
    + Serialize
    + DeserializeOwned
    + NumLimbs {
    const WITNESS_OFFSET: usize;
    const MODULUS: &'static [u8];
    const NB_BITS_PER_LIMB: usize = 8usize;
    const NB_LIMBS: usize = <Self::Limbs>::USIZE;
    const NB_WITNESS_LIMBS: usize = <Self::Witness>::USIZE;

    // Provided methods
    fn modulus() -> BigUint { ... }
    fn nb_bits() -> usize { ... }
    fn modulus_field_iter<F: Field>() -> impl Iterator<Item = F> { ... }
    fn to_limbs(x: &BigUint) -> Vec<u8>  { ... }
    fn to_limbs_field_vec<E: From<F>, F: Field>(x: &BigUint) -> Vec<E> { ... }
    fn to_limbs_field<E: From<F>, F: Field>(
        x: &BigUint,
    ) -> Limbs<E, Self::Limbs> { ... }
}

Required Associated Constants§

Source

const WITNESS_OFFSET: usize

Source

const MODULUS: &'static [u8]

The bytes of the modulus in little-endian order.

Provided Associated Constants§

Source

const NB_BITS_PER_LIMB: usize = 8usize

Source

const NB_LIMBS: usize = <Self::Limbs>::USIZE

Source

const NB_WITNESS_LIMBS: usize = <Self::Witness>::USIZE

Provided Methods§

Source

fn modulus() -> BigUint

Source

fn nb_bits() -> usize

Source

fn modulus_field_iter<F: Field>() -> impl Iterator<Item = F>

Source

fn to_limbs(x: &BigUint) -> Vec<u8>

Convert a BigUint to a Vec of u8 limbs (with len NB_LIMBS).

Source

fn to_limbs_field_vec<E: From<F>, F: Field>(x: &BigUint) -> Vec<E>

Convert a BigUint to a Vec of F limbs (with len NB_LIMBS).

Source

fn to_limbs_field<E: From<F>, F: Field>(x: &BigUint) -> Limbs<E, Self::Limbs>

Convert a BigUint to Limbs<F, Self::Limbs>.

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§