mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-10 16:11:29 +01:00
Add asserts for constraint count (#83)
* Add asserts for constraint count * switch to Standard strength
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nova-snark"
|
||||
version = "0.6.0"
|
||||
version = "0.6.1"
|
||||
authors = ["Srinath Setty <srinath@microsoft.com>"]
|
||||
edition = "2021"
|
||||
description = "Recursive zkSNARKs without trusted setup"
|
||||
|
||||
@@ -54,7 +54,6 @@ mod tests {
|
||||
let _ = synthesize_alloc_bit(&mut cs);
|
||||
let shape = cs.r1cs_shape();
|
||||
let gens = cs.r1cs_gens();
|
||||
println!("Mult mod constraint no: {}", cs.num_constraints());
|
||||
|
||||
// Now get the assignment
|
||||
let mut cs: SatisfyingAssignment<G> = SatisfyingAssignment::new();
|
||||
|
||||
@@ -404,10 +404,7 @@ mod tests {
|
||||
let mut cs: ShapeCS<G1> = ShapeCS::new();
|
||||
let _ = circuit1.synthesize(&mut cs);
|
||||
let (shape1, gens1) = (cs.r1cs_shape(), cs.r1cs_gens());
|
||||
println!(
|
||||
"Circuit1 -> Number of constraints: {}",
|
||||
cs.num_constraints()
|
||||
);
|
||||
assert_eq!(cs.num_constraints(), 20584);
|
||||
|
||||
// Initialize the shape and gens for the secondary
|
||||
let circuit2: NIFSVerifierCircuit<G1, TestCircuit<<G1 as Group>::Base>> =
|
||||
@@ -422,10 +419,7 @@ mod tests {
|
||||
let mut cs: ShapeCS<G2> = ShapeCS::new();
|
||||
let _ = circuit2.synthesize(&mut cs);
|
||||
let (shape2, gens2) = (cs.r1cs_shape(), cs.r1cs_gens());
|
||||
println!(
|
||||
"Circuit2 -> Number of constraints: {}",
|
||||
cs.num_constraints()
|
||||
);
|
||||
assert_eq!(cs.num_constraints(), 21124);
|
||||
|
||||
// Execute the base case for the primary
|
||||
let zero1 = <<G2 as Group>::Base as Field>::zero();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! This library implements core components of Nova.
|
||||
//! This library implements Nova, a high-speed recursive SNARK.
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
@@ -36,8 +36,8 @@ where
|
||||
/// Generate Poseidon constants for the arities that Nova uses
|
||||
#[allow(clippy::new_without_default)]
|
||||
fn new() -> Self {
|
||||
let constants27 = PoseidonConstants::<Scalar, U27>::new_with_strength(Strength::Strengthened);
|
||||
let constants32 = PoseidonConstants::<Scalar, U32>::new_with_strength(Strength::Strengthened);
|
||||
let constants27 = PoseidonConstants::<Scalar, U27>::new_with_strength(Strength::Standard);
|
||||
let constants32 = PoseidonConstants::<Scalar, U32>::new_with_strength(Strength::Standard);
|
||||
Self {
|
||||
constants27,
|
||||
constants32,
|
||||
|
||||
Reference in New Issue
Block a user