use serde feature to compute the digest of the shape (#132)

This commit is contained in:
Srinath Setty
2023-01-31 10:32:49 -08:00
committed by GitHub
parent 13964b6f16
commit 746af53e08
2 changed files with 25 additions and 25 deletions

View File

@@ -5,6 +5,7 @@ type G1 = pasta_curves::pallas::Point;
type G2 = pasta_curves::vesta::Point;
use ::bellperson::{gadgets::num::AllocatedNum, ConstraintSystem, SynthesisError};
use ff::PrimeField;
use flate2::{write::ZlibEncoder, Compression};
use nova_snark::{
traits::{
circuit::{StepCircuit, TrivialTestCircuit},
@@ -268,6 +269,14 @@ fn main() {
assert!(res.is_ok());
let compressed_snark = res.unwrap();
let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default());
bincode::serialize_into(&mut encoder, &compressed_snark).unwrap();
let compressed_snark_encoded = encoder.finish().unwrap();
println!(
"CompressedSNARK::len {:?} bytes",
compressed_snark_encoded.len()
);
// verify the compressed SNARK
println!("Verifying a CompressedSNARK...");
let start = Instant::now();