diff --git a/folding-schemes/src/folding/hypernova/circuits.rs b/folding-schemes/src/folding/hypernova/circuits.rs index 319bb0f6..2ebc4ef0 100644 --- a/folding-schemes/src/folding/hypernova/circuits.rs +++ b/folding-schemes/src/folding/hypernova/circuits.rs @@ -414,8 +414,8 @@ impl NIMFSGadget { /// Computes c from the step 5 in section 5 of HyperNova, adapted to multiple LCCCS & CCCS /// instances: /// $$ -/// c = \sum_{i \in [\mu]} \left(\sum_{j \in [t]} \gamma^{i \cdot t + j} \cdot e_i \cdot \sigma_{i,j} \right) -/// + \sum_{k \in [\nu]} \gamma^{\mu \cdot t+k} \cdot e_k \cdot \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} +/// c = \sum_{i \in [\mu]} \left(\sum_{j \in [t]} \gamma^{i \cdot t + j} \cdot e_i \cdot \sigma_{i,j} \right) + +/// \sum_{k \in [\nu]} \gamma^{\mu \cdot t+k} \cdot e_k \cdot \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} /// \theta_{k,j} \right) /// $$ #[allow(clippy::too_many_arguments)] diff --git a/folding-schemes/src/folding/hypernova/utils.rs b/folding-schemes/src/folding/hypernova/utils.rs index b2df2147..71b9108e 100644 --- a/folding-schemes/src/folding/hypernova/utils.rs +++ b/folding-schemes/src/folding/hypernova/utils.rs @@ -52,8 +52,8 @@ pub fn compute_sigmas_thetas( /// Computes c from the step 5 in section 5 of HyperNova, adapted to multiple LCCCS & CCCS /// instances: /// $$ -/// c = \sum_{i \in [\mu]} \left(\sum_{j \in [t]} \gamma^{i \cdot t + j} \cdot e_i \cdot \sigma_{i,j} \right) -/// + \sum_{k \in [\nu]} \gamma^{\mu \cdot t+k} \cdot e_k \cdot \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} +/// c = \sum_{i \in [\mu]} \left(\sum_{j \in [t]} \gamma^{i \cdot t + j} \cdot e_i \cdot \sigma_{i,j} \right) + +/// \sum_{k \in [\nu]} \gamma^{\mu \cdot t+k} \cdot e_k \cdot \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} /// \theta_{k,j} \right) /// $$ pub fn compute_c( diff --git a/folding-schemes/src/folding/nova/nifs/mod.rs b/folding-schemes/src/folding/nova/nifs/mod.rs index e233e3d5..ad3e4fa0 100644 --- a/folding-schemes/src/folding/nova/nifs/mod.rs +++ b/folding-schemes/src/folding/nova/nifs/mod.rs @@ -1,9 +1,11 @@ /// This module defines the traits related to the NIFS (Non-Interactive Folding Scheme). /// - NIFSTrait, which implements the NIFS interface /// - NIFSGadget, which implements the NIFS in-circuit -/// both traits implemented by the various Nova variants schemes; ie. -/// [Nova](https://eprint.iacr.org/2021/370.pdf), [Ova](https://hackmd.io/V4838nnlRKal9ZiTHiGYzw), -/// [Mova](https://eprint.iacr.org/2024/1220.pdf). +/// +/// Both traits implemented by the various Nova variants schemes; ie. +/// - [Nova](https://eprint.iacr.org/2021/370.pdf) +/// - [Ova](https://hackmd.io/V4838nnlRKal9ZiTHiGYzw) +/// - [Mova](https://eprint.iacr.org/2024/1220.pdf) use ark_crypto_primitives::sponge::{constraints::AbsorbGadget, Absorb, CryptographicSponge}; use ark_ec::CurveGroup; use ark_r1cs_std::{alloc::AllocVar, boolean::Boolean, fields::fp::FpVar}; diff --git a/folding-schemes/src/folding/nova/zk.rs b/folding-schemes/src/folding/nova/zk.rs index 206d3025..a560396a 100644 --- a/folding-schemes/src/folding/nova/zk.rs +++ b/folding-schemes/src/folding/nova/zk.rs @@ -73,7 +73,7 @@ where /// For further details on why folding is hiding, see lemma 9 pub fn new< GC1: CurveVar> + ToConstraintFieldGadget>, - GC2: CurveVar>, + GC2: CurveVar> + ToConstraintFieldGadget>, FC: FCircuit, CS1: CommitmentScheme, CS2: CommitmentScheme, @@ -87,7 +87,6 @@ where ::ScalarField: PrimeField, ::BaseField: PrimeField, ::BaseField: Absorb, - GC2: ToConstraintFieldGadget<::BaseField>, C1: CurveGroup, { let mut transcript = PoseidonSponge::::new(&nova.poseidon_config); @@ -140,7 +139,7 @@ where #[allow(clippy::too_many_arguments)] pub fn verify< CS1: CommitmentScheme, - GC2: CurveVar>, + GC2: CurveVar> + ToConstraintFieldGadget>, CS2: CommitmentScheme, >( r1cs: &R1CS, @@ -157,7 +156,6 @@ where ::ScalarField: Absorb, ::BaseField: PrimeField, ::BaseField: Absorb, - GC2: ToConstraintFieldGadget<::BaseField>, C1: CurveGroup, { // Handles case where i=0 diff --git a/folding-schemes/src/lib.rs b/folding-schemes/src/lib.rs index a829fe6d..890d6543 100644 --- a/folding-schemes/src/lib.rs +++ b/folding-schemes/src/lib.rs @@ -118,7 +118,8 @@ pub enum Error { /// over a cycle of curves (C1, C2), where: /// - C1 is the main curve, which ScalarField we use as our F for all the field operations /// - C2 is the auxiliary curve, which we use for the commitments, whose BaseField (for point -/// coordinates) are in the C1::ScalarField. +/// coordinates) are in the C1::ScalarField. +/// /// In other words, C1.Fq == C2.Fr, and C1.Fr == C2.Fq. pub trait FoldingScheme: Clone + Debug where diff --git a/folding-schemes/src/utils/espresso/virtual_polynomial.rs b/folding-schemes/src/utils/espresso/virtual_polynomial.rs index acc843b9..85296156 100644 --- a/folding-schemes/src/utils/espresso/virtual_polynomial.rs +++ b/folding-schemes/src/utils/espresso/virtual_polynomial.rs @@ -192,6 +192,7 @@ impl VirtualPolynomial { /// Multiple the current VirtualPolynomial by an MLE: /// - add the MLE to the MLE list; /// - multiple each product by MLE and its coefficient. + /// /// Returns an error if the MLE has a different `num_vars` from self. pub fn mul_by_mle( &mut self,