Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize Nova APIs #360

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nova-snark"
version = "0.39.0"
version = "0.40.0"
authors = ["Srinath Setty <[email protected]>"]
edition = "2021"
description = "High-speed recursive arguments from folding schemes"
Expand Down
2 changes: 1 addition & 1 deletion benches/compressed-snark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use criterion::{measurement::WallTime, *};
use ff::PrimeField;
use nova_snark::{
frontend::{num::AllocatedNum, ConstraintSystem, SynthesisError},
nova::{CompressedSNARK, PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::RelaxedR1CSSNARKTrait,
Engine,
},
CompressedSNARK, PublicParams, RecursiveSNARK,
};
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion benches/compute-digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion};
use ff::PrimeField;
use nova_snark::{
frontend::{num::AllocatedNum, ConstraintSystem, SynthesisError},
nova::PublicParams,
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Engine,
},
PublicParams,
};

type E1 = Bn256EngineKZG;
Expand Down
2 changes: 1 addition & 1 deletion benches/recursive-snark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use criterion::*;
use ff::PrimeField;
use nova_snark::{
frontend::{num::AllocatedNum, ConstraintSystem, SynthesisError},
nova::{PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Engine,
},
PublicParams, RecursiveSNARK,
};
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion benches/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use nova_snark::{
num::{AllocatedNum, Num},
sha256, AllocatedBit, Assignment, Boolean, ConstraintSystem, SynthesisError,
},
nova::{PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Engine,
},
PublicParams, RecursiveSNARK,
};
use sha2::{Digest, Sha256};

Expand Down
2 changes: 1 addition & 1 deletion examples/and.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use nova_snark::{
frontend::{
num::AllocatedNum, AllocatedBit, ConstraintSystem, LinearCombination, SynthesisError,
},
nova::{CompressedSNARK, PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::RelaxedR1CSSNARKTrait,
Engine, Group,
},
CompressedSNARK, PublicParams, RecursiveSNARK,
};
use rand::Rng;
use std::time::Instant;
Expand Down
2 changes: 1 addition & 1 deletion examples/hashchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use nova_snark::{
num::AllocatedNum,
ConstraintSystem, SynthesisError,
},
nova::{CompressedSNARK, PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::RelaxedR1CSSNARKTrait,
Engine, Group,
},
CompressedSNARK, PublicParams, RecursiveSNARK,
};
use std::time::Instant;

Expand Down
2 changes: 1 addition & 1 deletion examples/minroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use ff::Field;
use flate2::{write::ZlibEncoder, Compression};
use nova_snark::{
frontend::{num::AllocatedNum, ConstraintSystem, SynthesisError},
nova::{CompressedSNARK, PublicParams, RecursiveSNARK},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::RelaxedR1CSSNARKTrait,
Engine, Group,
},
CompressedSNARK, PublicParams, RecursiveSNARK,
};
use num_bigint::BigUint;
use std::time::Instant;
Expand Down
3 changes: 0 additions & 3 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ pub(crate) const NUM_CHALLENGE_BITS: usize = 128;
pub(crate) const NUM_HASH_BITS: usize = 250;
pub(crate) const BN_LIMB_WIDTH: usize = 64;
pub(crate) const BN_N_LIMBS: usize = 4;
pub(crate) const NUM_FE_WITHOUT_IO_FOR_CRHF: usize = 18;
pub(crate) const NUM_FE_FOR_RO: usize = 9;
pub(crate) const NUM_FE_FOR_RO_RELAXED: usize = 34;
4 changes: 2 additions & 2 deletions src/gadgets/r1cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::nonnative::{
util::{f_to_nat, Num},
};
use crate::{
constants::{NUM_CHALLENGE_BITS, NUM_FE_FOR_RO},
constants::NUM_CHALLENGE_BITS,
frontend::{num::AllocatedNum, Assignment, Boolean, ConstraintSystem, SynthesisError},
gadgets::{
ecc::AllocatedPoint,
Expand Down Expand Up @@ -234,7 +234,7 @@ impl<E: Engine> AllocatedRelaxedR1CSInstance<E> {
n_limbs: usize,
) -> Result<AllocatedRelaxedR1CSInstance<E>, SynthesisError> {
// Compute r:
let mut ro = E::ROCircuit::new(ro_consts, NUM_FE_FOR_RO);
let mut ro = E::ROCircuit::new(ro_consts);
ro.absorb(params);

// running instance `U` does not need to absorbed since u.X[0] = Hash(params, U, i, z0, zi)
Expand Down
Loading
Loading