Fix broken benchmarks
This commit is contained in:
parent
8c517e0afa
commit
b2edf157cd
|
@ -22,7 +22,7 @@ name = "secp256k1"
|
|||
path = "src/lib.rs"
|
||||
|
||||
[features]
|
||||
unstable = []
|
||||
unstable = ["recovery", "rand-std"]
|
||||
default = ["std"]
|
||||
std = ["secp256k1-sys/std"]
|
||||
rand-std = ["rand/std"]
|
||||
|
|
|
@ -304,7 +304,6 @@ mod benches {
|
|||
let s = Secp256k1::signing_only();
|
||||
let (sk, pk) = s.generate_keypair(&mut thread_rng());
|
||||
|
||||
let s = Secp256k1::new();
|
||||
bh.iter( || {
|
||||
let res = SharedSecret::new(&pk, &sk);
|
||||
black_box(res);
|
||||
|
|
|
@ -363,6 +363,10 @@ mod tests {
|
|||
|
||||
#[cfg(all(test, feature = "unstable"))]
|
||||
mod benches {
|
||||
use rand::{thread_rng, RngCore};
|
||||
use test::{Bencher, black_box};
|
||||
use super::{Message, Secp256k1};
|
||||
|
||||
#[bench]
|
||||
pub fn bench_recover(bh: &mut Bencher) {
|
||||
let s = Secp256k1::new();
|
||||
|
|
Loading…
Reference in New Issue