You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
551 B

5 years ago
  1. use rand;
  2. #[macro_use]
  3. extern crate criterion;
  4. use criterion::Criterion;
  5. use crypto_primitives::prf::*;
  6. use rand::Rng;
  7. fn blake2s_prf_eval(c: &mut Criterion) {
  8. let rng = &mut rand::thread_rng();
  9. let input: [u8; 32] = rng.gen();
  10. let seed: [u8; 32] = rng.gen();
  11. c.bench_function("Blake2s PRF Eval", move |b| {
  12. b.iter(|| Blake2s::evaluate(&seed, &input).unwrap())
  13. });
  14. }
  15. criterion_group! {
  16. name = prf_eval;
  17. config = Criterion::default().sample_size(50);
  18. targets = blake2s_prf_eval
  19. }
  20. criterion_main!(prf_eval);