Add benchmarks for some pairing subroutines.

This commit is contained in:
Sean Bowe 2019-11-22 13:09:56 -07:00
parent ea4374cc73
commit 059e03ca9d
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,18 @@ fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("full pairing", move |b| {
b.iter(|| pairing(black_box(&g), black_box(&h)))
});
c.bench_function("G2 preparation for pairing", move |b| {
b.iter(|| G2Prepared::from(h))
});
let prep = G2Prepared::from(h);
c.bench_function("miller loop for pairing", move |b| {
b.iter(|| multi_miller_loop(&[(&g, &prep)]))
});
let prep = G2Prepared::from(h);
let r = multi_miller_loop(&[(&g, &prep)]);
c.bench_function("final exponentiation for pairing", move |b| {
b.iter(|| r.final_exponentiation())
});
}
// G1Affine
{