snark_verifier::loader

Trait ScalarLoader

Source
pub trait ScalarLoader<F: PrimeField> {
    type LoadedScalar: LoadedScalar<F, Loader = Self>;

Show 14 methods // Required methods fn load_const(&self, value: &F) -> Self::LoadedScalar; fn assert_eq( &self, annotation: &str, lhs: &Self::LoadedScalar, rhs: &Self::LoadedScalar, ); // Provided methods fn load_zero(&self) -> Self::LoadedScalar { ... } fn load_one(&self) -> Self::LoadedScalar { ... } fn sum_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar { ... } fn sum_products_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar { ... } fn sum_with_coeff( &self, values: &[(F, &Self::LoadedScalar)], ) -> Self::LoadedScalar { ... } fn sum_with_const( &self, values: &[&Self::LoadedScalar], constant: F, ) -> Self::LoadedScalar { ... } fn sum(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar { ... } fn sum_products_with_coeff( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar { ... } fn sum_products_with_const( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar { ... } fn sum_products( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar { ... } fn product(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar { ... } fn batch_invert<'a>( values: impl IntoIterator<Item = &'a mut Self::LoadedScalar>, ) where Self::LoadedScalar: 'a { ... }
}
Expand description

Field element loader.

Required Associated Types§

Required Methods§

Source

fn load_const(&self, value: &F) -> Self::LoadedScalar

Load a constant field element.

Source

fn assert_eq( &self, annotation: &str, lhs: &Self::LoadedScalar, rhs: &Self::LoadedScalar, )

Assert lhs and rhs field elements are equal.

Provided Methods§

Source

fn load_zero(&self) -> Self::LoadedScalar

Load zero as constant.

Source

fn load_one(&self) -> Self::LoadedScalar

Load one as constant.

Source

fn sum_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar

Sum field elements with coefficients and constant.

Source

fn sum_products_with_coeff_and_const( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar

Sum product of field elements with coefficients and constant.

Source

fn sum_with_coeff( &self, values: &[(F, &Self::LoadedScalar)], ) -> Self::LoadedScalar

Sum field elements with coefficients.

Source

fn sum_with_const( &self, values: &[&Self::LoadedScalar], constant: F, ) -> Self::LoadedScalar

Sum field elements and constant.

Source

fn sum(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar

Sum field elements.

Source

fn sum_products_with_coeff( &self, values: &[(F, &Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar

Sum product of field elements with coefficients.

Source

fn sum_products_with_const( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], constant: F, ) -> Self::LoadedScalar

Sum product of field elements and constant.

Source

fn sum_products( &self, values: &[(&Self::LoadedScalar, &Self::LoadedScalar)], ) -> Self::LoadedScalar

Sum product of field elements.

Source

fn product(&self, values: &[&Self::LoadedScalar]) -> Self::LoadedScalar

Product of field elements.

Source

fn batch_invert<'a>( values: impl IntoIterator<Item = &'a mut Self::LoadedScalar>, )
where Self::LoadedScalar: 'a,

Batch invert field elements.

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.

Implementations on Foreign Types§

Source§

impl<C: CurveAffine, EccChip: EccInstructions<C>> ScalarLoader<<C as PrimeCurveAffine>::Scalar> for Rc<Halo2Loader<C, EccChip>>

Source§

type LoadedScalar = Scalar<C, EccChip>

Source§

fn load_const(&self, value: &C::Scalar) -> Scalar<C, EccChip>

Source§

fn assert_eq( &self, _annotation: &str, lhs: &Scalar<C, EccChip>, rhs: &Scalar<C, EccChip>, )

Source§

fn sum_with_coeff_and_const( &self, values: &[(C::Scalar, &Scalar<C, EccChip>)], constant: C::Scalar, ) -> Scalar<C, EccChip>

Source§

fn sum_products_with_coeff_and_const( &self, values: &[(C::Scalar, &Scalar<C, EccChip>, &Scalar<C, EccChip>)], constant: C::Scalar, ) -> Scalar<C, EccChip>

Source§

impl<F: PrimeField<Repr = [u8; 32]>> ScalarLoader<F> for Rc<EvmLoader>

Source§

type LoadedScalar = Scalar

Source§

fn load_const(&self, value: &F) -> Scalar

Source§

fn assert_eq(&self, _: &str, _: &Scalar, _: &Scalar)

Source§

fn sum_with_coeff_and_const( &self, values: &[(F, &Scalar)], constant: F, ) -> Scalar

Source§

fn sum_products_with_coeff_and_const( &self, values: &[(F, &Scalar, &Scalar)], constant: F, ) -> Scalar

Source§

fn batch_invert<'a>(values: impl IntoIterator<Item = &'a mut Scalar>)

Implementors§