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
810 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_ec::{PairingEngine, ProjectiveCurve};
  6. use ark_ff::{
  7. biginteger::BigInteger768 as FqRepr, BigInteger, Field, PrimeField, SquareRootField,
  8. UniformRand,
  9. };
  10. use ark_mnt4_753::{
  11. fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
  12. MNT4_753,
  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!(extension, Fq2, Fq2, fq2);
  23. f_bench!(target, Fq4, Fq4, fq4);
  24. f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
  25. f_bench!(Fr, Fr, FqRepr, FqRepr, fr);
  26. pairing_bench!(MNT4_753, Fq4);
  27. bencher::benchmark_main!(fq, fr, fq2, fq4, g1::group_ops, g2::group_ops, pairing);