-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench_BSW07.rs
32 lines (24 loc) · 1001 Bytes
/
bench_BSW07.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use rabe_BSW07::my_setup_BSW07;
use rabe_BSW07::setup_keygen_BSW07;
use rabe_BSW07::setup_encrypt_BSW07;
use rabe_BSW07::setup_keygen_encrypt_BSW07;
use criterion::{
criterion_group,
criterion_main,
black_box,
Criterion
};
fn my_setup_BSW07_benchmark(c: &mut Criterion) {
c.bench_function("setup", |b| b.iter(||my_setup_BSW07()));
}
fn setup_keygen_BSW07_benchmark(c: &mut Criterion) {
c.bench_function("keygen + setup", |b| b.iter(||setup_keygen_BSW07()));
}
fn setup_encrypt_BSW07_benchmark(c: &mut Criterion) {
c.bench_function("setup + encrypt", |b| b.iter(||setup_encrypt_BSW07()));
}
fn setup_keygen_encrypt_BSW07_benchmark(c: &mut Criterion) {
c.bench_function("setup + keygen + encrypt + decrypt", |b| b.iter(||setup_keygen_encrypt_BSW07()));
}
criterion_group!(benches, my_setup_BSW07_benchmark, setup_keygen_BSW07_benchmark, setup_encrypt_BSW07_benchmark, setup_keygen_encrypt_BSW07_benchmark);
criterion_main!(benches);