Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mimc test benches #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions tests/mimc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,15 @@ fn test_mimc_groth16() {
let mut total_proving = Duration::new(0, 0);
let mut total_verifying = Duration::new(0, 0);

// Just a place to put the proof data, so we can
// benchmark deserialization.
// let mut proof_vec = vec![];

for _ in 0..SAMPLES {
// Generate a random preimage and compute the image
let xl = rng.gen();
let xr = rng.gen();
let image = mimc(xl, xr, &constants);

// proof_vec.truncate(0);

let start = Instant::now();
{
let start = Instant::now();

// Create an instance of our circuit (with the
// witness)
let c = MiMCDemo {
Expand All @@ -201,20 +196,18 @@ fn test_mimc_groth16() {

// Create a groth16 proof with our parameters.
let proof = Groth16::<Bls12_377>::prove(&pk, c, &mut rng).unwrap();

total_proving += start.elapsed();

let start = Instant::now();

// Check the proof
assert!(
Groth16::<Bls12_377>::verify_with_processed_vk(&pvk, &[image], &proof).unwrap()
);

// proof.write(&mut proof_vec).unwrap();
total_verifying += start.elapsed();
}

total_proving += start.elapsed();

let start = Instant::now();
// let proof = Proof::read(&proof_vec[..]).unwrap();
// Check the proof

total_verifying += start.elapsed();
}
let proving_avg = total_proving / SAMPLES;
let proving_avg =
Expand Down