pub type BaseFieldEccChip<'chip, C> = EccChip<'chip, <C as CurveAffine>::ScalarExt, FpChip<'chip, <C as CurveAffine>::ScalarExt, <C as CurveAffine>::Base>>;
Aliased Type§
struct BaseFieldEccChip<'chip, C> {
pub field_chip: &'chip FpChip<'chip, <C as CurveAffine>::ScalarExt, <C as CurveAffine>::Base>,
/* private fields */
}
Fields§
§field_chip: &'chip FpChip<'chip, <C as CurveAffine>::ScalarExt, <C as CurveAffine>::Base>
Implementations
Source§impl<F: BigPrimeField, FC> EccChip<'_, F, FC>
impl<F: BigPrimeField, FC> EccChip<'_, F, FC>
pub fn select( &self, ctx: &mut Context<F>, P: EcPoint<F, FC::FieldPoint>, Q: EcPoint<F, FC::FieldPoint>, condition: AssignedValue<F>, ) -> EcPoint<F, FC::FieldPoint>
Sourcepub fn scalar_mult<C>(
&self,
ctx: &mut Context<F>,
P: EcPoint<F, FC::FieldPoint>,
scalar: Vec<AssignedValue<F>>,
max_bits: usize,
window_bits: usize,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn scalar_mult<C>(
&self,
ctx: &mut Context<F>,
P: EcPoint<F, FC::FieldPoint>,
scalar: Vec<AssignedValue<F>>,
max_bits: usize,
window_bits: usize,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
See scalar_multiply
for more details.
Sourcepub fn variable_base_msm<C>(
&self,
thread_pool: &mut SinglePhaseCoreManager<F>,
P: &[EcPoint<F, FC::FieldPoint>],
scalars: Vec<Vec<AssignedValue<F>>>,
max_bits: usize,
) -> EcPoint<F, FC::FieldPoint>
pub fn variable_base_msm<C>( &self, thread_pool: &mut SinglePhaseCoreManager<F>, P: &[EcPoint<F, FC::FieldPoint>], scalars: Vec<Vec<AssignedValue<F>>>, max_bits: usize, ) -> EcPoint<F, FC::FieldPoint>
See pippenger::multi_exp_par
for more details.
pub fn variable_base_msm_custom<C>( &self, builder: &mut SinglePhaseCoreManager<F>, P: &[EcPoint<F, FC::FieldPoint>], scalars: Vec<Vec<AssignedValue<F>>>, max_bits: usize, window_bits: usize, ) -> EcPoint<F, FC::FieldPoint>
Source§impl<F: BigPrimeField, FC: FieldChip<F>> EccChip<'_, F, FC>
impl<F: BigPrimeField, FC: FieldChip<F>> EccChip<'_, F, FC>
Sourcepub fn fixed_base_scalar_mult<C>(
&self,
ctx: &mut Context<F>,
point: &C,
scalar: Vec<AssignedValue<F>>,
max_bits: usize,
window_bits: usize,
) -> EcPoint<F, FC::FieldPoint>
pub fn fixed_base_scalar_mult<C>( &self, ctx: &mut Context<F>, point: &C, scalar: Vec<AssignedValue<F>>, max_bits: usize, window_bits: usize, ) -> EcPoint<F, FC::FieldPoint>
See fixed_base::scalar_multiply
for more details.
pub fn fixed_base_msm<C>( &self, builder: &mut SinglePhaseCoreManager<F>, points: &[C], scalars: Vec<Vec<AssignedValue<F>>>, max_scalar_bits_per_cell: usize, ) -> EcPoint<F, FC::FieldPoint>
Sourcepub fn fixed_base_msm_custom<C>(
&self,
builder: &mut SinglePhaseCoreManager<F>,
points: &[C],
scalars: Vec<Vec<AssignedValue<F>>>,
max_scalar_bits_per_cell: usize,
clump_factor: usize,
) -> EcPoint<F, FC::FieldPoint>
pub fn fixed_base_msm_custom<C>( &self, builder: &mut SinglePhaseCoreManager<F>, points: &[C], scalars: Vec<Vec<AssignedValue<F>>>, max_scalar_bits_per_cell: usize, clump_factor: usize, ) -> EcPoint<F, FC::FieldPoint>
clump_factor = 0
means auto-calculate
The user should filter out base points that are identity beforehand; we do not separately do this here
Source§impl<'chip, F: BigPrimeField, FC: FieldChip<F>> EccChip<'chip, F, FC>
impl<'chip, F: BigPrimeField, FC: FieldChip<F>> EccChip<'chip, F, FC>
pub fn new(field_chip: &'chip FC) -> Self
pub fn field_chip(&self) -> &FC
Sourcepub fn load_private<C>(
&self,
ctx: &mut Context<F>,
(x, y): (FC::FieldType, FC::FieldType),
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn load_private<C>(
&self,
ctx: &mut Context<F>,
(x, y): (FC::FieldType, FC::FieldType),
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
Load affine point as private witness. Constrains witness to lie on curve. Does not allow (0, 0) point,
Sourcepub fn load_private_unchecked(
&self,
ctx: &mut Context<F>,
(x, y): (FC::FieldType, FC::FieldType),
) -> EcPoint<F, FC::FieldPoint>
pub fn load_private_unchecked( &self, ctx: &mut Context<F>, (x, y): (FC::FieldType, FC::FieldType), ) -> EcPoint<F, FC::FieldPoint>
Does not constrain witness to lie on curve
Sourcepub fn assign_point<C>(
&self,
ctx: &mut Context<F>,
g: C,
) -> EcPoint<F, FC::FieldPoint>
pub fn assign_point<C>( &self, ctx: &mut Context<F>, g: C, ) -> EcPoint<F, FC::FieldPoint>
Load affine point as private witness. Constrains witness to either lie on curve or be the point at infinity, represented in affine coordinates as (0, 0).
Sourcepub fn assign_point_unchecked<C>(
&self,
ctx: &mut Context<F>,
g: C,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn assign_point_unchecked<C>(
&self,
ctx: &mut Context<F>,
g: C,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
Does not constrain witness to lie on curve
pub fn assign_constant_point<C>(
&self,
ctx: &mut Context<F>,
g: C,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn load_random_point<C>(
&self,
ctx: &mut Context<F>,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn assert_is_on_curve<C>(
&self,
ctx: &mut Context<F>,
P: &EcPoint<F, FC::FieldPoint>,
)where
C: CurveAffine<Base = FC::FieldType>,
pub fn is_on_curve_or_infinity<C>(
&self,
ctx: &mut Context<F>,
P: &EcPoint<F, FC::FieldPoint>,
) -> AssignedValue<F>where
C: CurveAffine<Base = FC::FieldType>,
pub fn negate( &self, ctx: &mut Context<F>, P: impl Into<EcPoint<F, FC::FieldPoint>>, ) -> EcPoint<F, FC::FieldPoint>
Sourcepub fn add_unequal(
&self,
ctx: &mut Context<F>,
P: impl Into<ComparableEcPoint<F, FC>>,
Q: impl Into<ComparableEcPoint<F, FC>>,
is_strict: bool,
) -> EcPoint<F, FC::FieldPoint>
pub fn add_unequal( &self, ctx: &mut Context<F>, P: impl Into<ComparableEcPoint<F, FC>>, Q: impl Into<ComparableEcPoint<F, FC>>, is_strict: bool, ) -> EcPoint<F, FC::FieldPoint>
Assumes that P.x != Q.x
If is_strict == true
, then actually constrains that P.x != Q.x
Sourcepub fn sub_unequal(
&self,
ctx: &mut Context<F>,
P: impl Into<ComparableEcPoint<F, FC>>,
Q: impl Into<ComparableEcPoint<F, FC>>,
is_strict: bool,
) -> EcPoint<F, FC::FieldPoint>
pub fn sub_unequal( &self, ctx: &mut Context<F>, P: impl Into<ComparableEcPoint<F, FC>>, Q: impl Into<ComparableEcPoint<F, FC>>, is_strict: bool, ) -> EcPoint<F, FC::FieldPoint>
Assumes that P.x != Q.x Otherwise will panic
pub fn double( &self, ctx: &mut Context<F>, P: impl Into<EcPoint<F, FC::FieldPoint>>, ) -> EcPoint<F, FC::FieldPoint>
pub fn is_equal( &self, ctx: &mut Context<F>, P: EcPoint<F, FC::FieldPoint>, Q: EcPoint<F, FC::FieldPoint>, ) -> AssignedValue<F>
pub fn assert_equal( &self, ctx: &mut Context<F>, P: EcPoint<F, FC::FieldPoint>, Q: EcPoint<F, FC::FieldPoint>, )
Sourcepub fn sum<C>(
&self,
ctx: &mut Context<F>,
points: impl IntoIterator<Item = EcPoint<F, FC::FieldPoint>>,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
pub fn sum<C>(
&self,
ctx: &mut Context<F>,
points: impl IntoIterator<Item = EcPoint<F, FC::FieldPoint>>,
) -> EcPoint<F, FC::FieldPoint>where
C: CurveAffineExt<Base = FC::FieldType>,
None of elements in points
can be point at infinity.