snark_verifier::loader::halo2

Trait EccInstructions

Source
pub trait EccInstructions<C: CurveAffine>: Clone + Debug {
    type Context: Debug + Default;
    type ScalarChip: IntegerInstructions<C::Scalar, Context = Self::Context, AssignedCell = Self::AssignedCell, AssignedInteger = Self::AssignedScalar>;
    type AssignedCell: Clone + Debug;
    type AssignedScalar: Clone + Debug;
    type AssignedEcPoint: Clone + Debug;

    // Required methods
    fn scalar_chip(&self) -> &Self::ScalarChip;
    fn assign_constant(
        &self,
        ctx: &mut Self::Context,
        ec_point: C,
    ) -> Self::AssignedEcPoint;
    fn assign_point(
        &self,
        ctx: &mut Self::Context,
        ec_point: C,
    ) -> Self::AssignedEcPoint;
    fn sum_with_const(
        &self,
        ctx: &mut Self::Context,
        values: &[impl Deref<Target = Self::AssignedEcPoint>],
        constant: C,
    ) -> Self::AssignedEcPoint;
    fn fixed_base_msm(
        &mut self,
        ctx: &mut Self::Context,
        pairs: &[(impl Deref<Target = Self::AssignedScalar>, C)],
    ) -> Self::AssignedEcPoint;
    fn variable_base_msm(
        &mut self,
        ctx: &mut Self::Context,
        pairs: &[(impl Deref<Target = Self::AssignedScalar>, impl Deref<Target = Self::AssignedEcPoint>)],
    ) -> Self::AssignedEcPoint;
    fn assert_equal(
        &self,
        ctx: &mut Self::Context,
        lhs: &Self::AssignedEcPoint,
        rhs: &Self::AssignedEcPoint,
    );
}
Expand description

Instructions to handle elliptic curve point operations.

Required Associated Types§

Source

type Context: Debug + Default

Context

Source

type ScalarChip: IntegerInstructions<C::Scalar, Context = Self::Context, AssignedCell = Self::AssignedCell, AssignedInteger = Self::AssignedScalar>

IntegerInstructions to handle scalar field operation.

Source

type AssignedCell: Clone + Debug

Assigned cell.

Source

type AssignedScalar: Clone + Debug

Assigned scalar field element.

Source

type AssignedEcPoint: Clone + Debug

Assigned elliptic curve point.

Required Methods§

Source

fn scalar_chip(&self) -> &Self::ScalarChip

Returns reference of EccInstructions::ScalarChip.

Source

fn assign_constant( &self, ctx: &mut Self::Context, ec_point: C, ) -> Self::AssignedEcPoint

Assign a elliptic curve point constant.

Source

fn assign_point( &self, ctx: &mut Self::Context, ec_point: C, ) -> Self::AssignedEcPoint

Assign a elliptic curve point witness.

Source

fn sum_with_const( &self, ctx: &mut Self::Context, values: &[impl Deref<Target = Self::AssignedEcPoint>], constant: C, ) -> Self::AssignedEcPoint

Sum elliptic curve points and constant.

Source

fn fixed_base_msm( &mut self, ctx: &mut Self::Context, pairs: &[(impl Deref<Target = Self::AssignedScalar>, C)], ) -> Self::AssignedEcPoint

Perform fixed base multi-scalar multiplication.

Source

fn variable_base_msm( &mut self, ctx: &mut Self::Context, pairs: &[(impl Deref<Target = Self::AssignedScalar>, impl Deref<Target = Self::AssignedEcPoint>)], ) -> Self::AssignedEcPoint

Perform variable base multi-scalar multiplication.

Source

fn assert_equal( &self, ctx: &mut Self::Context, lhs: &Self::AssignedEcPoint, rhs: &Self::AssignedEcPoint, )

Enforce lhs and rhs are equal.

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<'chip, C: CurveAffineExt> EccInstructions<C> for BaseFieldEccChip<'chip, C>

Source§

type Context = SinglePhaseCoreManager<<C as PrimeCurveAffine>::Scalar>

Source§

type ScalarChip = GateChip<<C as PrimeCurveAffine>::Scalar>

Source§

type AssignedCell = AssignedValue<<C as PrimeCurveAffine>::Scalar>

Source§

type AssignedScalar = AssignedValue<<C as PrimeCurveAffine>::Scalar>

Source§

type AssignedEcPoint = EcPoint<<C as CurveAffine>::ScalarExt, ProperCrtUint<<C as CurveAffine>::ScalarExt>>

Source§

fn scalar_chip(&self) -> &Self::ScalarChip

Source§

fn assign_constant( &self, ctx: &mut Self::Context, point: C, ) -> Self::AssignedEcPoint

Source§

fn assign_point( &self, ctx: &mut Self::Context, point: C, ) -> Self::AssignedEcPoint

Source§

fn sum_with_const( &self, ctx: &mut Self::Context, values: &[impl Deref<Target = Self::AssignedEcPoint>], constant: C, ) -> Self::AssignedEcPoint

Source§

fn variable_base_msm( &mut self, builder: &mut Self::Context, pairs: &[(impl Deref<Target = Self::AssignedScalar>, impl Deref<Target = Self::AssignedEcPoint>)], ) -> Self::AssignedEcPoint

Source§

fn fixed_base_msm( &mut self, builder: &mut Self::Context, pairs: &[(impl Deref<Target = Self::AssignedScalar>, C)], ) -> Self::AssignedEcPoint

Source§

fn assert_equal( &self, ctx: &mut Self::Context, a: &Self::AssignedEcPoint, b: &Self::AssignedEcPoint, )

Implementors§