Type Alias BaseFieldEccChip

Source
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>
where FC: Selectable<F, FC::FieldPoint> + FieldChip<F>,

Source

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>

Source

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.

Source

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>
where C: CurveAffineExt<Base = FC::FieldType>, FC: Selectable<F, FC::ReducedFieldPoint>,

See pippenger::multi_exp_par for more details.

Source

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>
where C: CurveAffineExt<Base = FC::FieldType>, FC: Selectable<F, FC::ReducedFieldPoint>,

Source§

impl<F: BigPrimeField, FC: FieldChip<F>> EccChip<'_, F, FC>

Source

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>
where C: CurveAffineExt, FC: FieldChip<F, FieldType = C::Base> + Selectable<F, FC::FieldPoint>,

See fixed_base::scalar_multiply for more details.

Source

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>
where C: CurveAffineExt, FC: FieldChip<F, FieldType = C::Base> + Selectable<F, FC::FieldPoint>,

Source

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>
where C: CurveAffineExt, FC: FieldChip<F, FieldType = C::Base> + Selectable<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>

Source

pub fn new(field_chip: &'chip FC) -> Self

Source

pub fn field_chip(&self) -> &FC

Source

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,

Source

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

Source

pub fn assign_point<C>( &self, ctx: &mut Context<F>, g: C, ) -> EcPoint<F, FC::FieldPoint>
where C: CurveAffineExt<Base = FC::FieldType>, C::Base: PrimeField,

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).

Source

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

Source

pub fn assign_constant_point<C>( &self, ctx: &mut Context<F>, g: C, ) -> EcPoint<F, FC::FieldPoint>
where C: CurveAffineExt<Base = FC::FieldType>,

Source

pub fn load_random_point<C>( &self, ctx: &mut Context<F>, ) -> EcPoint<F, FC::FieldPoint>
where C: CurveAffineExt<Base = FC::FieldType>,

Source

pub fn assert_is_on_curve<C>( &self, ctx: &mut Context<F>, P: &EcPoint<F, FC::FieldPoint>, )
where C: CurveAffine<Base = FC::FieldType>,

Source

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>,

Source

pub fn negate( &self, ctx: &mut Context<F>, P: impl Into<EcPoint<F, FC::FieldPoint>>, ) -> EcPoint<F, FC::FieldPoint>

Source

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

Source

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

Source

pub fn double( &self, ctx: &mut Context<F>, P: impl Into<EcPoint<F, FC::FieldPoint>>, ) -> EcPoint<F, FC::FieldPoint>

Source

pub fn is_equal( &self, ctx: &mut Context<F>, P: EcPoint<F, FC::FieldPoint>, Q: EcPoint<F, FC::FieldPoint>, ) -> AssignedValue<F>

Source

pub fn assert_equal( &self, ctx: &mut Context<F>, P: EcPoint<F, FC::FieldPoint>, Q: EcPoint<F, FC::FieldPoint>, )

Source

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.

Trait Implementations

Source§

impl<'chip, F: Clone + BigPrimeField, FC: Clone + FieldChip<F>> Clone for EccChip<'chip, F, FC>

Source§

fn clone(&self) -> EccChip<'chip, F, FC>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'chip, F: Debug + BigPrimeField, FC: Debug + FieldChip<F>> Debug for EccChip<'chip, F, FC>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more