#![allow(incomplete_features)] #![feature(generic_const_exprs)] #![feature(const_trait_impl)] use criterion::{black_box, criterion_group, criterion_main, Criterion}; use cryptix_ecc::CurvePoint; use cryptix_pairing::Pairing; use cryptix_bn254::pairing::e1::BN254Fp; use cryptix_bn254::pairing::e2::BN254Fp2; use cryptix_bn254::pairing::o_ate::OptimalAte; use criterion_cycles_per_byte::CyclesPerByte; fn bench_pairing(c: &mut Criterion) { c.bench_function("bench pairing operation cycle", |b| { let p = BN254Fp::GENERATOR; let q = BN254Fp2::GENERATOR; b.iter(|| black_box(OptimalAte::pairing(p, q))) }); } criterion_group!( name = pairing_benches; config = Criterion::default().with_measurement(CyclesPerByte); targets = bench_pairing ); criterion_main!(pairing_benches);