You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
821 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. use ark_algebra_bench_templates::*;
  2. use ark_std::ops::{AddAssign, MulAssign, SubAssign};
  3. use ark_bls12_377::{
  4. fq::Fq, fq2::Fq2, fr::Fr, Bls12_377, Fq12, G1Affine, G1Projective as G1, G2Affine,
  5. G2Projective as G2,
  6. };
  7. use ark_ec::bls12::{G1Prepared, G2Prepared};
  8. use ark_ec::{CurveGroup, Group};
  9. use ark_ff::{
  10. biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
  11. BigInteger, Field, PrimeField, UniformRand,
  12. };
  13. mod g1 {
  14. use super::*;
  15. ec_bench!(G1, G1Affine);
  16. }
  17. mod g2 {
  18. use super::*;
  19. ec_bench!(G2, G2Affine);
  20. }
  21. f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
  22. f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
  23. f_bench!(extension, Fq2, Fq2, fq2);
  24. f_bench!(target, Fq12, Fq12, fq12);
  25. pairing_bench!(Bls12_377, Fq12);
  26. bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);