poplar/poplar_crypto/benches/ratchet.rs

16 lines
469 B
Rust

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);