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