Browse Source

Format

reduce-generics
Pratyush Mishra 3 years ago
parent
commit
6805e05b50
6 changed files with 31 additions and 45 deletions
  1. +4
    -8
      bls12_377/src/constraints/curves.rs
  2. +11
    -5
      curve-constraint-tests/src/lib.rs
  3. +4
    -8
      mnt4_298/src/constraints/curves.rs
  4. +4
    -8
      mnt4_753/src/constraints/curves.rs
  5. +4
    -8
      mnt6_298/src/constraints/curves.rs
  6. +4
    -8
      mnt6_753/src/constraints/curves.rs

+ 4
- 8
bls12_377/src/constraints/curves.rs

@ -16,12 +16,8 @@ pub type G2PreparedVar = bls12::G2PreparedVar;
#[test] #[test]
fn test() { fn test() {
use ark_ec::models::bls12::Bls12Parameters; use ark_ec::models::bls12::Bls12Parameters;
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as Bls12Parameters>::G1Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as Bls12Parameters>::G2Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as Bls12Parameters>::G1Parameters>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as Bls12Parameters>::G2Parameters>()
.unwrap();
} }

+ 11
- 5
curve-constraint-tests/src/lib.rs

@ -231,7 +231,11 @@ pub mod fields {
} }
pub mod curves { pub mod curves {
use ark_ec::{ModelParameters, ProjectiveCurve, short_weierstrass_jacobian::GroupProjective as SWProjective, twisted_edwards_extended::GroupProjective as TEProjective};
use ark_ec::{
short_weierstrass_jacobian::GroupProjective as SWProjective,
twisted_edwards_extended::GroupProjective as TEProjective, ModelParameters,
ProjectiveCurve,
};
use ark_ff::{BitIteratorLE, Field, FpParameters, One, PrimeField}; use ark_ff::{BitIteratorLE, Field, FpParameters, One, PrimeField};
use ark_relations::r1cs::{ConstraintSystem, SynthesisError}; use ark_relations::r1cs::{ConstraintSystem, SynthesisError};
use ark_std::{test_rng, vec::Vec, UniformRand}; use ark_std::{test_rng, vec::Vec, UniformRand};
@ -257,10 +261,12 @@ pub mod curves {
let mut rng = test_rng(); let mut rng = test_rng();
let a_native = C::rand(&mut rng); let a_native = C::rand(&mut rng);
let b_native = C::rand(&mut rng); let b_native = C::rand(&mut rng);
let a = C::Var::new_variable(ark_relations::ns!(cs, "generate_a"), || Ok(a_native), mode)
.unwrap();
let b = C::Var::new_variable(ark_relations::ns!(cs, "generate_b"), || Ok(b_native), mode)
.unwrap();
let a =
C::Var::new_variable(ark_relations::ns!(cs, "generate_a"), || Ok(a_native), mode)
.unwrap();
let b =
C::Var::new_variable(ark_relations::ns!(cs, "generate_b"), || Ok(b_native), mode)
.unwrap();
let zero = C::Var::zero(); let zero = C::Var::zero();
assert_eq!(zero.value()?, zero.value()?); assert_eq!(zero.value()?, zero.value()?);

+ 4
- 8
mnt4_298/src/constraints/curves.rs

@ -16,12 +16,8 @@ pub type G2PreparedVar = mnt4::G2PreparedVar;
#[test] #[test]
fn test() { fn test() {
use ark_ec::models::mnt4::MNT4Parameters; use ark_ec::models::mnt4::MNT4Parameters;
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT4Parameters>::G1Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT4Parameters>::G2Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT4Parameters>::G1Parameters>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT4Parameters>::G2Parameters>()
.unwrap();
} }

+ 4
- 8
mnt4_753/src/constraints/curves.rs

@ -16,12 +16,8 @@ pub type G2PreparedVar = mnt4::G2PreparedVar;
#[test] #[test]
fn test() { fn test() {
use ark_ec::models::mnt4::MNT4Parameters; use ark_ec::models::mnt4::MNT4Parameters;
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT4Parameters>::G1Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT4Parameters>::G2Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT4Parameters>::G1Parameters>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT4Parameters>::G2Parameters>()
.unwrap();
} }

+ 4
- 8
mnt6_298/src/constraints/curves.rs

@ -16,12 +16,8 @@ pub type G2PreparedVar = mnt6::G2PreparedVar;
#[test] #[test]
fn test() { fn test() {
use ark_ec::models::mnt6::MNT6Parameters; use ark_ec::models::mnt6::MNT6Parameters;
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT6Parameters>::G1Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT6Parameters>::G2Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT6Parameters>::G1Parameters>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT6Parameters>::G2Parameters>()
.unwrap();
} }

+ 4
- 8
mnt6_753/src/constraints/curves.rs

@ -16,12 +16,8 @@ pub type G2PreparedVar = mnt6::G2PreparedVar;
#[test] #[test]
fn test() { fn test() {
use ark_ec::models::mnt6::MNT6Parameters; use ark_ec::models::mnt6::MNT6Parameters;
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT6Parameters>::G1Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<
<Parameters as MNT6Parameters>::G2Parameters,
>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT6Parameters>::G1Parameters>()
.unwrap();
ark_curve_constraint_tests::curves::sw_test::<<Parameters as MNT6Parameters>::G2Parameters>()
.unwrap();
} }

Loading…
Cancel
Save