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.

39 lines
928 B

  1. #![allow(unused_imports)]
  2. use ark_ff::{
  3. fields::{Field, FpParameters, PrimeField, SquareRootField},
  4. One, Zero,
  5. };
  6. use ark_serialize::CanonicalSerialize;
  7. use ark_std::test_rng;
  8. use ark_ec::{models::SWModelParameters, AffineCurve, PairingEngine, ProjectiveCurve};
  9. use core::ops::{AddAssign, MulAssign};
  10. use rand::Rng;
  11. use crate::{Affine, Projective, VestaParameters};
  12. use ark_curve_tests::{
  13. curves::{curve_tests, sw_tests},
  14. groups::group_test,
  15. };
  16. #[test]
  17. fn test_projective_curve() {
  18. curve_tests::<Projective>();
  19. sw_tests::<VestaParameters>();
  20. }
  21. #[test]
  22. fn test_projective_group() {
  23. let mut rng = test_rng();
  24. let a: Projective = rng.gen();
  25. let b: Projective = rng.gen();
  26. group_test(a, b);
  27. }
  28. #[test]
  29. fn test_generator() {
  30. let generator = Affine::prime_subgroup_generator();
  31. assert!(generator.is_on_curve());
  32. assert!(generator.is_in_correct_subgroup_assuming_on_curve());
  33. }