Skip to content

Commit

Permalink
Revert changes made outside parafold
Browse files Browse the repository at this point in the history
  • Loading branch information
adr1anh committed Feb 28, 2024
1 parent e01bd6d commit a15223e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
25 changes: 11 additions & 14 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@
//! of the running instances. Each of these hashes is H(params = H(shape, ck), i, z0, zi, U).
//! Each circuit folds the last invocation of the other into the running instance
use abomonation_derive::Abomonation;
use bellpepper::gadgets::Assignment;
use bellpepper_core::{
boolean::{AllocatedBit, Boolean},
num::AllocatedNum,
ConstraintSystem, SynthesisError,
};
use ff::Field;
use serde::{Deserialize, Serialize};

use crate::{
constants::{NIO_NOVA_FOLD, NUM_FE_WITHOUT_IO_FOR_CRHF, NUM_HASH_BITS},
gadgets::{
Expand All @@ -29,6 +19,15 @@ use crate::{
},
Commitment,
};
use abomonation_derive::Abomonation;
use bellpepper::gadgets::Assignment;
use bellpepper_core::{
boolean::{AllocatedBit, Boolean},
num::AllocatedNum,
ConstraintSystem, SynthesisError,
};
use ff::Field;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Abomonation)]
pub struct NovaAugmentedCircuitParams {
Expand Down Expand Up @@ -363,8 +362,7 @@ impl<'a, E: Engine, SC: StepCircuit<E::Base>> NovaAugmentedCircuit<'a, E, SC> {

#[cfg(test)]
mod tests {
use expect_test::{expect, Expect};

use super::*;
use crate::{
bellpepper::{
r1cs::{NovaShape, NovaWitness},
Expand All @@ -379,8 +377,7 @@ mod tests {
},
traits::{circuit::TrivialCircuit, snark::default_ck_hint, CurveCycleEquipped, Dual},
};

use super::*;
use expect_test::{expect, Expect};

// In the following we use 1 to refer to the primary, and 2 to refer to the secondary circuit
fn test_recursive_circuit_with<E1>(
Expand Down
2 changes: 1 addition & 1 deletion src/nifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod tests {
) {
// produce a default running instance
let mut r_W = RelaxedR1CSWitness::default(shape);
let mut r_U = RelaxedR1CSInstance::default(shape);
let mut r_U = RelaxedR1CSInstance::default(ck, shape);

// produce a step SNARK with (W1, U1) as the first incoming witness-instance pair
let res = NIFS::prove(ck, ro_consts, pp_digest, shape, &r_U, &r_W, U1, W1);
Expand Down
1 change: 1 addition & 0 deletions src/parafold/nivc/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::parafold::nivc::{
use crate::parafold::transcript::circuit::AllocatedTranscript;
use crate::parafold::transcript::TranscriptConstants;
use crate::supernova::EnforcingStepCircuit;

use crate::traits::Engine;

/// A representation of a NIVC state, where `io` represents the computations inputs and outputs,
Expand Down
4 changes: 2 additions & 2 deletions src/r1cs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct R1CSResult<E: Engine> {
/// A type that holds a witness for a given R1CS instance
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct R1CSWitness<E: Engine> {
pub(crate) W: Vec<E::Scalar>,
W: Vec<E::Scalar>,
}

/// A type that holds an R1CS instance
Expand Down Expand Up @@ -704,7 +704,7 @@ impl<E: Engine> RelaxedR1CSWitness<E> {

impl<E: Engine> RelaxedR1CSInstance<E> {
/// Produces a default `RelaxedR1CSInstance` given `R1CSGens` and `R1CSShape`
pub fn default(S: &R1CSShape<E>) -> Self {
pub fn default(_ck: &CommitmentKey<E>, S: &R1CSShape<E>) -> Self {
let (comm_W, comm_E) = (Commitment::<E>::default(), Commitment::<E>::default());
Self {
comm_W,
Expand Down
2 changes: 1 addition & 1 deletion src/supernova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use bellpepper_core::ConstraintSystem;
use crate::nifs::NIFS;

mod circuit; // declare the module first
pub use circuit::{StepCircuit, TrivialSecondaryCircuit, TrivialTestCircuit};
pub use circuit::{EnforcingStepCircuit, StepCircuit, TrivialSecondaryCircuit, TrivialTestCircuit};
use circuit::{
SuperNovaAugmentedCircuit, SuperNovaAugmentedCircuitInputs, SuperNovaAugmentedCircuitParams,
};
Expand Down

0 comments on commit a15223e

Please sign in to comment.