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.

32 lines
847 B

4 years ago
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 rand::SeedableRng;
  3. use rand_xorshift::XorShiftRng;
  4. use std::ops::{AddAssign, MulAssign, SubAssign};
  5. use ark_bls12_377::{
  6. fq::Fq, fq2::Fq2, fr::Fr, Bls12_377, Fq12, G1Affine, G1Projective as G1, G2Affine,
  7. G2Projective as G2,
  8. };
  9. use ark_ec::{PairingEngine, ProjectiveCurve};
  10. use ark_ff::{
  11. biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
  12. BigInteger, Field, PrimeField, SquareRootField, UniformRand,
  13. };
  14. mod g1 {
  15. use super::*;
  16. ec_bench!(G1, G1Affine);
  17. }
  18. mod g2 {
  19. use super::*;
  20. ec_bench!(G2, G2Affine);
  21. }
  22. f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
  23. f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
  24. f_bench!(extension, Fq2, Fq2, fq2);
  25. f_bench!(target, Fq12, Fq12, fq12);
  26. pairing_bench!(Bls12_377, Fq12);
  27. bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);