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
834 B

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_cp6_782::{
  6. fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
  7. CP6_782,
  8. };
  9. use ark_ec::{PairingEngine, ProjectiveCurve};
  10. use ark_ff::{
  11. biginteger::{BigInteger384 as FrRepr, BigInteger832 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!(extension, Fq3, Fq3, fq3);
  23. f_bench!(target, Fq6, Fq6, fq6);
  24. f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
  25. f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
  26. pairing_bench!(CP6_782, Fq6);
  27. bencher::benchmark_main!(fq, fr, fq3, fq6, g1::group_ops, g2::group_ops, pairing);