Trait sp1_core::operations::field::params::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>.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl FieldParameters for Ed25519BaseField

source§

const MODULUS: &'static [u8] = _

source§

const WITNESS_OFFSET: usize = 16_384usize

source§

impl FieldParameters for U256Field

source§

const MODULUS: &'static [u8] = _

source§

const WITNESS_OFFSET: usize = 16_384usize

source§

impl FieldParameters for Bls12381BaseField

source§

const NB_LIMBS: usize = 48usize

source§

const MODULUS: &'static [u8] = _

source§

const WITNESS_OFFSET: usize = 32_768usize

source§

impl FieldParameters for Bn254BaseField

source§

const MODULUS: &'static [u8] = _

source§

const WITNESS_OFFSET: usize = 16_384usize

source§

impl FieldParameters for Secp256k1BaseField

source§

const MODULUS: &'static [u8] = _

source§

const WITNESS_OFFSET: usize = 16_384usize