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.

29 lines
743 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. use ark_curve_benches::*;
  2. use ark_std::ops::{AddAssign, MulAssign, SubAssign};
  3. use ark_bn254::{
  4. fq::Fq, fq2::Fq2, fr::Fr, Bn254, Fq12, G1Affine, G1Projective as G1, G2Affine,
  5. G2Projective as G2,
  6. };
  7. use ark_ec::{PairingEngine, ProjectiveCurve};
  8. use ark_ff::{
  9. biginteger::BigInteger256 as Repr, BigInteger, Field, PrimeField, SquareRootField, UniformRand,
  10. };
  11. mod g1 {
  12. use super::*;
  13. ec_bench!(G1, G1Affine);
  14. }
  15. mod g2 {
  16. use super::*;
  17. ec_bench!(G2, G2Affine);
  18. }
  19. f_bench!(Fq, Fq, Repr, Repr, fq);
  20. f_bench!(Fr, Fr, Repr, Repr, fr);
  21. f_bench!(extension, Fq2, Fq2, fq2);
  22. f_bench!(target, Fq12, Fq12, fq12);
  23. pairing_bench!(Bn254, Fq12);
  24. bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);