Fix benchmarks

This commit is contained in:
Andrew Poelstra 2015-09-20 15:18:53 -05:00
parent b42b1f9408
commit 5ce825398a
2 changed files with 2 additions and 2 deletions

View File

@ -112,6 +112,7 @@ mod benches {
use rand::{Rng, thread_rng}; use rand::{Rng, thread_rng};
use test::{Bencher, black_box}; use test::{Bencher, black_box};
use super::SharedSecret;
use super::super::{Secp256k1, Message}; use super::super::{Secp256k1, Message};
#[bench] #[bench]
@ -120,7 +121,6 @@ mod benches {
let (sk, pk) = s.generate_keypair(&mut thread_rng()).unwrap(); let (sk, pk) = s.generate_keypair(&mut thread_rng()).unwrap();
let s = Secp256k1::new(); let s = Secp256k1::new();
let mut r = CounterRng(0);
bh.iter( || { bh.iter( || {
let res = SharedSecret::new(&s, &pk, &sk); let res = SharedSecret::new(&s, &pk, &sk);
black_box(res); black_box(res);

View File

@ -729,7 +729,7 @@ mod benches {
thread_rng().fill_bytes(&mut msg); thread_rng().fill_bytes(&mut msg);
let msg = Message::from_slice(&msg).unwrap(); let msg = Message::from_slice(&msg).unwrap();
let (sk, _) = s.generate_keypair(&mut thread_rng()).unwrap(); let (sk, _) = s.generate_keypair(&mut thread_rng()).unwrap();
let sig = s.sign(&msg, &sk).unwrap(); let sig = s.sign_recoverable(&msg, &sk).unwrap();
bh.iter(|| { bh.iter(|| {
let res = s.recover(&msg, &sig).unwrap(); let res = s.recover(&msg, &sig).unwrap();