poplar/poplar_crypto/benches/ratchet.rs

16 lines
469 B
Rust
Raw Permalink Normal View History

2023-06-10 15:44:18 +00:00
use criterion::{BatchSize, Criterion, criterion_group, criterion_main};
use rand_core::OsRng;
use poplar_crypto::ratchet::{Ratchet, RatchetingWheel};
pub fn benchmark(c: &mut Criterion) {
c.bench_function("ratchet multistep", {
|b| b.iter_batched_ref(|| {
Ratchet::random(&mut OsRng)
}, |r| {
r.ratchet.step_once();
}, BatchSize::SmallInput)
});
}
criterion_group!(benches, benchmark);
criterion_main!(benches);