Browse Source

Update crate versions (#119)

* update crate versions

* fix clippy issues

* cargo fmt
main
Srinath Setty 2 years ago
committed by GitHub
parent
commit
6044aff625
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 18 deletions
  1. +5
    -6
      Cargo.toml
  2. +1
    -1
      src/bellperson/shape_cs.rs
  3. +2
    -8
      src/r1cs.rs
  4. +2
    -2
      src/spartan_with_ipa_pc/mod.rs
  5. +1
    -1
      src/spartan_with_ipa_pc/polynomial.rs

+ 5
- 6
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "nova-snark" name = "nova-snark"
version = "0.8.1"
version = "0.9.0"
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"
@ -11,7 +11,7 @@ license-file = "LICENSE"
keywords = ["zkSNARKs", "cryptography", "proofs"] keywords = ["zkSNARKs", "cryptography", "proofs"]
[dependencies] [dependencies]
bellperson = { version = "0.22", default-features = false }
bellperson = { version = "0.24", default-features = false }
ff = "0.12.0" ff = "0.12.0"
merlin = "2.0.0" merlin = "2.0.0"
rand = "0.8.4" rand = "0.8.4"
@ -24,9 +24,9 @@ itertools = "0.9.0"
subtle = "2.4" subtle = "2.4"
pasta_curves = { version = "0.4.0", features = ["repr-c"] } pasta_curves = { version = "0.4.0", features = ["repr-c"] }
pasta-msm = "0.1.3" pasta-msm = "0.1.3"
neptune = { version = "7.2.0", default-features = false }
neptune = { version = "8.1.0", default-features = false }
generic-array = "0.14.4" generic-array = "0.14.4"
bellperson-nonnative = { version = "0.3.1", default-features = false, features = ["wasm"] }
bellperson-nonnative = { version = "0.4.0", default-features = false }
num-bigint = { version = "0.4", features = ["serde", "rand"] } num-bigint = { version = "0.4", features = ["serde", "rand"] }
num-traits = "0.2" num-traits = "0.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
@ -46,5 +46,4 @@ name = "compressed-snark"
harness = false harness = false
[features] [features]
default = [ "bellperson/default", "bellperson-nonnative/default", "neptune/default" ]
wasm = [ "bellperson/wasm", "bellperson-nonnative/wasm", "neptune/wasm" ]
default = [ "bellperson/default", "bellperson-nonnative/default", "neptune/default" ]

+ 1
- 1
src/bellperson/shape_cs.rs

@ -147,7 +147,7 @@ where
let negone = -<G::Scalar>::one(); let negone = -<G::Scalar>::one();
let powers_of_two = (0..G::Scalar::NUM_BITS) let powers_of_two = (0..G::Scalar::NUM_BITS)
.map(|i| G::Scalar::from(2u64).pow_vartime(&[u64::from(i)]))
.map(|i| G::Scalar::from(2u64).pow_vartime([u64::from(i)]))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let pp = |s: &mut String, lc: &LinearCombination<G::Scalar>| { let pp = |s: &mut String, lc: &LinearCombination<G::Scalar>| {

+ 2
- 8
src/r1cs.rs

@ -191,13 +191,7 @@ impl R1CSShape {
assert_eq!(Cz.len(), self.num_cons); assert_eq!(Cz.len(), self.num_cons);
let res: usize = (0..self.num_cons) let res: usize = (0..self.num_cons)
.map(|i| {
if Az[i] * Bz[i] == U.u * Cz[i] + W.E[i] {
0
} else {
1
}
})
.map(|i| usize::from(Az[i] * Bz[i] != U.u * Cz[i] + W.E[i]))
.sum(); .sum();
res == 0 res == 0
@ -235,7 +229,7 @@ impl R1CSShape {
assert_eq!(Cz.len(), self.num_cons); assert_eq!(Cz.len(), self.num_cons);
let res: usize = (0..self.num_cons) let res: usize = (0..self.num_cons)
.map(|i| if Az[i] * Bz[i] == Cz[i] { 0 } else { 1 })
.map(|i| usize::from(Az[i] * Bz[i] != Cz[i]))
.sum(); .sum();
res == 0 res == 0

+ 2
- 2
src/spartan_with_ipa_pc/mod.rs

@ -98,7 +98,7 @@ impl RelaxedR1CSSNARKTrait for RelaxedR1CSSNARK {
let (num_rounds_x, num_rounds_y) = ( let (num_rounds_x, num_rounds_y) = (
(pk.S.num_cons as f64).log2() as usize, (pk.S.num_cons as f64).log2() as usize,
((pk.S.num_vars as f64).log2() as usize + 1) as usize,
((pk.S.num_vars as f64).log2() as usize + 1),
); );
// outer sum-check // outer sum-check
@ -264,7 +264,7 @@ impl RelaxedR1CSSNARKTrait for RelaxedR1CSSNARK {
let (num_rounds_x, num_rounds_y) = ( let (num_rounds_x, num_rounds_y) = (
(vk.S.num_cons as f64).log2() as usize, (vk.S.num_cons as f64).log2() as usize,
((vk.S.num_vars as f64).log2() as usize + 1) as usize,
((vk.S.num_vars as f64).log2() as usize + 1),
); );
// outer sum-check // outer sum-check

+ 1
- 1
src/spartan_with_ipa_pc/polynomial.rs

@ -20,7 +20,7 @@ impl EqPolynomial {
pub fn evals(&self) -> Vec<Scalar> { pub fn evals(&self) -> Vec<Scalar> {
let ell = self.r.len(); let ell = self.r.len();
let mut evals: Vec<Scalar> = vec![Scalar::zero(); (2_usize).pow(ell as u32) as usize];
let mut evals: Vec<Scalar> = vec![Scalar::zero(); (2_usize).pow(ell as u32)];
let mut size = 1; let mut size = 1;
evals[0] = Scalar::one(); evals[0] = Scalar::one();

Loading…
Cancel
Save