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§
Sourcetype ScalarChip: IntegerInstructions<C::Scalar, Context = Self::Context, AssignedCell = Self::AssignedCell, AssignedInteger = Self::AssignedScalar>
type ScalarChip: IntegerInstructions<C::Scalar, Context = Self::Context, AssignedCell = Self::AssignedCell, AssignedInteger = Self::AssignedScalar>
IntegerInstructions
to handle scalar field operation.
Sourcetype AssignedCell: Clone + Debug
type AssignedCell: Clone + Debug
Assigned cell.
Sourcetype AssignedScalar: Clone + Debug
type AssignedScalar: Clone + Debug
Assigned scalar field element.
Sourcetype AssignedEcPoint: Clone + Debug
type AssignedEcPoint: Clone + Debug
Assigned elliptic curve point.
Required Methods§
Sourcefn scalar_chip(&self) -> &Self::ScalarChip
fn scalar_chip(&self) -> &Self::ScalarChip
Returns reference of EccInstructions::ScalarChip
.
Sourcefn assign_constant(
&self,
ctx: &mut Self::Context,
ec_point: C,
) -> Self::AssignedEcPoint
fn assign_constant( &self, ctx: &mut Self::Context, ec_point: C, ) -> Self::AssignedEcPoint
Assign a elliptic curve point constant.
Sourcefn assign_point(
&self,
ctx: &mut Self::Context,
ec_point: C,
) -> Self::AssignedEcPoint
fn assign_point( &self, ctx: &mut Self::Context, ec_point: C, ) -> Self::AssignedEcPoint
Assign a elliptic curve point witness.
Sourcefn sum_with_const(
&self,
ctx: &mut Self::Context,
values: &[impl Deref<Target = Self::AssignedEcPoint>],
constant: C,
) -> Self::AssignedEcPoint
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.
Sourcefn fixed_base_msm(
&mut self,
ctx: &mut Self::Context,
pairs: &[(impl Deref<Target = Self::AssignedScalar>, C)],
) -> Self::AssignedEcPoint
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.
Sourcefn variable_base_msm(
&mut self,
ctx: &mut Self::Context,
pairs: &[(impl Deref<Target = Self::AssignedScalar>, impl Deref<Target = Self::AssignedEcPoint>)],
) -> 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
Perform variable base multi-scalar multiplication.
Sourcefn assert_equal(
&self,
ctx: &mut Self::Context,
lhs: &Self::AssignedEcPoint,
rhs: &Self::AssignedEcPoint,
)
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.