Skip to content

Commit

Permalink
Add NIFSGadgetTrait, implement Mova's NIFSGadget, adapt Nova NIFSGadg…
Browse files Browse the repository at this point in the history
…et into NIFSGadgetTrait

* add new NIFSGadgetTrait

* implement Mova's NIFSGadget

* refactor Nova NIFSGadget to fit into the new NIFSGadgetTrait

* abstract NIFSGadget related tests for all implementors of
  NIFSGadgetTrait to avoid duplicated code in the tests between the
  different Nova variants gadget tests
  • Loading branch information
arnaucube committed Nov 4, 2024
1 parent b812dd6 commit fb5917d
Show file tree
Hide file tree
Showing 18 changed files with 779 additions and 400 deletions.
2 changes: 1 addition & 1 deletion examples/full_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<F: PrimeField> FCircuit<F> for CubicFCircuit<F> {
}

fn main() {
let n_steps = 10;
let n_steps = 5;
// set the initial state
let z_0 = vec![Fr::from(3_u32)];

Expand Down
7 changes: 1 addition & 6 deletions examples/noir_full_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ fn main() {
let z_0 = vec![Fr::from(1)];

// initialize the noir fcircuit
let cur_path = env::current_dir().unwrap();

let circuit_path = format!(
"{}/frontends/src/noir/test_folder/test_mimc/target/test_mimc.json",
cur_path.to_str().unwrap()
);
let circuit_path = format!("./frontends/src/noir/test_folder/test_mimc/target/test_mimc.json",);

let circuit = load_noir_circuit(circuit_path).unwrap();
let f_circuit = NoirFCircuit {
Expand Down
4 changes: 2 additions & 2 deletions folding-schemes/src/arith/r1cs/circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ pub mod tests {
nonnative::uint::NonNativeUintVar,
},
nova::{
circuits::CommittedInstanceVar, decider_eth_circuit::WitnessVar, CommittedInstance,
Witness,
decider_eth_circuit::WitnessVar, nifs::nova_circuits::CommittedInstanceVar,
CommittedInstance, Witness,
},
};
use crate::frontend::{
Expand Down
2 changes: 1 addition & 1 deletion folding-schemes/src/folding/circuits/decider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub mod tests {
use ark_std::UniformRand;

use super::*;
use crate::folding::nova::{circuits::CommittedInstanceVar, CommittedInstance};
use crate::folding::nova::{nifs::nova_circuits::CommittedInstanceVar, CommittedInstance};
use crate::transcript::poseidon::poseidon_canonical_config;

// checks that the gadget and native implementations of the challenge computation match
Expand Down
2 changes: 1 addition & 1 deletion folding-schemes/src/folding/circuits/decider/off_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{
nonnative::affine::NonNativeAffineVar,
CF1, CF2,
},
nova::{circuits::CommittedInstanceVar, decider_eth_circuit::WitnessVar},
nova::{decider_eth_circuit::WitnessVar, nifs::nova_circuits::CommittedInstanceVar},
traits::{CommittedInstanceOps, CommittedInstanceVarOps, Dummy, WitnessOps, WitnessVarOps},
},
};
Expand Down
Loading

0 comments on commit fb5917d

Please sign in to comment.