diff --git a/src/cyclefold/nova_circuit.rs b/src/cyclefold/nova_circuit.rs index 9fdc9d722..c3fb04c9c 100644 --- a/src/cyclefold/nova_circuit.rs +++ b/src/cyclefold/nova_circuit.rs @@ -17,7 +17,6 @@ use bellpepper::gadgets::num::AllocatedNum; use bellpepper_core::{ConstraintSystem, SynthesisError}; use serde::{Deserialize, Serialize}; -/// TODO: docs #[derive(Clone, PartialEq, Serialize, Deserialize, Abomonation)] pub struct AugmentedCircuitParams { limb_width: usize, @@ -47,7 +46,6 @@ impl FoldingData { } } -/// TODO: Docs #[derive(Debug, Serialize, Deserialize)] #[serde(bound = "")] pub struct AugmentedCircuitInputs @@ -57,16 +55,16 @@ where { pp_digest: E1::Scalar, i: E1::Base, - z0: Vec, + z0: Vec, - zi: Option>, - data_p: Option>, + zi: Option>, + data_p: Option>, - data_c_1: Option>, - data_c_2: Option>, + data_c_1: Option>, + data_c_2: Option>, - E_new: Option>, - W_new: Option>, + E_new: Option>, + W_new: Option>, } impl AugmentedCircuitInputs @@ -77,13 +75,13 @@ where pub fn new( pp_digest: E1::Scalar, i: E1::Base, - z0: Vec, - zi: Option>, - data_p: Option>, - data_c_1: Option>, - data_c_2: Option>, - E_new: Option>, - W_new: Option>, + z0: Vec, + zi: Option>, + data_p: Option>, + data_c_1: Option>, + data_c_2: Option>, + E_new: Option>, + W_new: Option>, ) -> Self { Self { pp_digest, @@ -98,12 +96,11 @@ where } } } - pub struct AugmentedCircuit<'a, E1, E2, SC> where E1: Engine::Scalar>, E2: Engine::Scalar>, - SC: StepCircuit, + SC: StepCircuit, { params: &'a AugmentedCircuitParams, ro_consts: ROConstantsCircuit, @@ -115,7 +112,7 @@ impl<'a, E1, E2, SC> AugmentedCircuit<'a, E1, E2, SC> where E1: Engine::Scalar>, E2: Engine::Scalar>, - SC: StepCircuit, + SC: StepCircuit, { pub const fn new( params: &'a AugmentedCircuitParams, @@ -162,7 +159,7 @@ where pub fn synthesize::Base>>( self, cs: &mut CS, - ) -> Result>, SynthesisError> { + ) -> Result>, SynthesisError> { // TODO: It's written down here https://hackmd.io/@mpenciak/HybHrnNFT todo!() } diff --git a/src/cyclefold/snark.rs b/src/cyclefold/snark.rs index 566a75972..f764fdae9 100644 --- a/src/cyclefold/snark.rs +++ b/src/cyclefold/snark.rs @@ -254,11 +254,11 @@ where let data_p = FoldingData::new(self.r_U_primary.clone(), self.l_u_primary.clone(), comm_T); let data_c_E = FoldingData::new(r_U_cyclefold_E, l_u_cyclefold_E, comm_T_E); - let data_c_W = FoldingData::new(r_U_cyclefold_W, l_u_cyclefold_W, comm_T_W); + let data_c_W = FoldingData::new(r_U_cyclefold_W.clone(), l_u_cyclefold_W, comm_T_W); - let inputs_primary = AugmentedCircuitInputs::new( - pp.digest(), - ::Scalar::from(self.i as u64), + let inputs_primary: AugmentedCircuitInputs = AugmentedCircuitInputs::new( + scalar_as_base::(pp.digest()), + ::Base::from(self.i as u64), self.z0_primary.clone(), Some(self.zi_primary.clone()), Some(data_p),