summaryrefslogtreecommitdiffstats
path: root/openpgp/benches/random.rs
blob: af8e4b9aa4bf0a4118c041bb5281e5c510ef91c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use criterion::{black_box, criterion_group, criterion_main, AxisScale, Criterion, BenchmarkId, PlotConfiguration};

use sequoia_openpgp::crypto;
use sequoia_openpgp::parse::Parse;

fn test_random() {
    let mut buf = vec![0; 32];
    crypto::random(&mut buf);
}

fn bench_random(c: &mut Criterion) {
    c.bench_function("crypto::random", |b| b.iter(|| test_random() ));
}

criterion_group!(benches, bench_random);
criterion_main!(benches);