Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
Begin CurveEndoGate2
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubarov committed Dec 10, 2020
1 parent 6f7fc2d commit 5ff0d41
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion src/gates2/curve_endo.rs
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
pub struct CurveEndoGate2;
use std::marker::PhantomData;

use crate::{CircuitConfig, ConstraintPolynomial, Curve, Gate2, SimpleGenerator, WitnessGenerator2};

/// Performs a step of Halo's accumulate-with-endomorphism loop.
pub struct CurveEndoGate2<C: Curve> {
_phantom: PhantomData<C>,
}

impl<C: Curve> CurveEndoGate2<C> {
pub const WIRE_ADDEND_X: usize = 0;
pub const WIRE_ADDEND_Y: usize = 1;
pub const WIRE_SCALAR_BIT_0: usize = 2;
pub const WIRE_SCALAR_BIT_1: usize = 3;
pub const WIRE_GROUP_ACC_X: usize = 4;
pub const WIRE_GROUP_ACC_Y: usize = 5;
pub const WIRE_INVERSE: usize = 6;
}

impl<C: Curve> Gate2<C::BaseField> for CurveEndoGate2<C> {
fn id(&self) -> String {
"CurveEndoGate".into()
}

fn constraints(&self, _config: CircuitConfig) -> Vec<ConstraintPolynomial<C::BaseField>> {
unimplemented!()
}

fn generators(
&self,
_config: CircuitConfig,
gate_index: usize,
_local_constants: Vec<C::BaseField>,
_next_constants: Vec<<C as Curve>::BaseField>,
) -> Vec<Box<dyn WitnessGenerator2<C::BaseField>>> {
unimplemented!()
}
}

struct CurveEndoGateGenerator<C: Curve> {
gate_index: usize,
_phantom: PhantomData<C>,
}

impl<C: Curve> SimpleGenerator<C::BaseField> for CurveEndoGateGenerator<C> {}

0 comments on commit 5ff0d41

Please sign in to comment.