Skip to content

Commit

Permalink
fix benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
oleganza committed Dec 12, 2019
1 parent 5a1e345 commit af6d51e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ clear_on_drop = { version = "0.2", default-features = false, features = ["nightl

[dev-dependencies]
hex = "0.3"
criterion = "0.2"
criterion = "0.3"
bincode = "1"
rand_chacha = "0.2"

Expand Down
7 changes: 4 additions & 3 deletions benches/r1cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use bulletproofs::{BulletproofGens, PedersenGens};
use curve25519_dalek::ristretto::CompressedRistretto;
use curve25519_dalek::scalar::Scalar;
use merlin::Transcript;
use rand::{thread_rng, Rng};
use rand::{Rng};
use rand::seq::SliceRandom;

// Shuffle gadget (documented in markdown file)

Expand Down Expand Up @@ -177,7 +178,7 @@ fn bench_kshuffle_prove(c: &mut Criterion) {
.map(|_| Scalar::from(rng.gen_range(min, max)))
.collect();
let mut output = input.clone();
rand::thread_rng().shuffle(&mut output);
output.shuffle(&mut rand::thread_rng());

// Make kshuffle proof
b.iter(|| {
Expand Down Expand Up @@ -219,7 +220,7 @@ fn bench_kshuffle_verify(c: &mut Criterion) {
.map(|_| Scalar::from(rng.gen_range(min, max)))
.collect();
let mut output = input.clone();
rand::thread_rng().shuffle(&mut output);
output.shuffle(&mut rand::thread_rng());

let mut prover_transcript = Transcript::new(b"ShuffleBenchmark");

Expand Down

0 comments on commit af6d51e

Please sign in to comment.