mirror of
https://github.com/vacp2p/zk-explorations.git
synced 2026-01-09 20:17:59 -05:00
Merge pull request #35 from vacp2p/nova-bellman-proof-size
Nova bellman proof size
This commit is contained in:
36
nova-bellman/Cargo.lock
generated
36
nova-bellman/Cargo.lock
generated
@@ -13,6 +13,12 @@ dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "1.1.2"
|
||||
@@ -319,6 +325,15 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "criterion"
|
||||
version = "0.5.1"
|
||||
@@ -545,6 +560,16 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flume"
|
||||
version = "0.10.14"
|
||||
@@ -773,6 +798,15 @@ dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
|
||||
dependencies = [
|
||||
"adler",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "neptune"
|
||||
version = "11.0.0"
|
||||
@@ -819,8 +853,10 @@ dependencies = [
|
||||
"bellpepper",
|
||||
"bellpepper-core",
|
||||
"bellperson",
|
||||
"bincode",
|
||||
"criterion",
|
||||
"ff",
|
||||
"flate2",
|
||||
"generic-array",
|
||||
"neptune 11.0.0 (git+https://github.com/tyshko-rostyslav/neptune.git?branch=multiple-return-values)",
|
||||
"nova-snark",
|
||||
|
||||
@@ -18,6 +18,8 @@ subtle = "=2.5.0"
|
||||
bellpepper-core = "*"
|
||||
bellpepper = "*"
|
||||
rand_xorshift = "0.3.0"
|
||||
bincode = "1.3"
|
||||
flate2 = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
|
||||
@@ -7,6 +7,7 @@ use nova_bellman::{
|
||||
};
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use flate2::{write::ZlibEncoder, Compression};
|
||||
|
||||
criterion_group! {
|
||||
name = recursive_snark;
|
||||
@@ -92,6 +93,16 @@ fn bench_recursive_snark_verify(c: &mut Criterion) {
|
||||
|
||||
let zi = calculate_chain_hash(initial_state, num_steps);
|
||||
|
||||
|
||||
let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default());
|
||||
bincode::serialize_into(&mut encoder, &recursive_snark.0).unwrap();
|
||||
let snark_encoded = encoder.finish().unwrap();
|
||||
println!(
|
||||
"Nova Bellman SNARK::len {:?} bytes for case {:?}",
|
||||
snark_encoded.len(),
|
||||
num_steps
|
||||
);
|
||||
|
||||
group.bench_function("Verify", |b| {
|
||||
b.iter(|| {
|
||||
let res = recursive_snark.verify(&pp, num_steps, z0.clone(), &zi);
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
|
||||
use nova::{errors::NovaError, traits::Group, RecursiveSNARK};
|
||||
|
||||
pub struct NovaChainHashProof(RecursiveSNARK<G1, G2, C1, C2>);
|
||||
pub struct NovaChainHashProof(pub RecursiveSNARK<G1, G2, C1, C2>);
|
||||
|
||||
impl NovaChainHashProof {
|
||||
pub fn prove_recursively(
|
||||
|
||||
Reference in New Issue
Block a user