From 50388bdc22eca7c046824c2d20db2121706ec187 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Mon, 24 Aug 2020 00:47:21 -0700 Subject: [PATCH] Update concrete curves in `r1cs-std`. --- r1cs-std/src/instantiated/bls12_377/curves.rs | 20 ++++++------- r1cs-std/src/instantiated/bls12_377/fields.rs | 28 +++++++++---------- .../src/instantiated/bls12_377/pairing.rs | 4 +-- .../instantiated/ed_on_bls12_377/curves.rs | 8 +++--- .../instantiated/ed_on_bls12_377/fields.rs | 6 ++-- .../instantiated/ed_on_bls12_381/curves.rs | 8 +++--- .../instantiated/ed_on_bls12_381/fields.rs | 6 ++-- .../src/instantiated/ed_on_bn254/curves.rs | 8 +++--- .../src/instantiated/ed_on_bn254/fields.rs | 6 ++-- .../src/instantiated/ed_on_bw6_761/fields.rs | 2 +- .../src/instantiated/ed_on_cp6_782/curves.rs | 8 +++--- .../src/instantiated/ed_on_cp6_782/fields.rs | 6 ++-- .../src/instantiated/ed_on_mnt4_298/curves.rs | 8 +++--- .../src/instantiated/ed_on_mnt4_298/fields.rs | 6 ++-- .../src/instantiated/ed_on_mnt4_753/curves.rs | 8 +++--- .../src/instantiated/ed_on_mnt4_753/fields.rs | 6 ++-- r1cs-std/src/instantiated/mnt4_298/curves.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt4_298/fields.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt4_298/pairing.rs | 4 +-- r1cs-std/src/instantiated/mnt4_753/curves.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt4_753/fields.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt4_753/pairing.rs | 4 +-- r1cs-std/src/instantiated/mnt6_298/curves.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt6_298/fields.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt6_298/pairing.rs | 4 +-- r1cs-std/src/instantiated/mnt6_753/curves.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt6_753/fields.rs | 20 ++++++------- r1cs-std/src/instantiated/mnt6_753/pairing.rs | 4 +-- 28 files changed, 157 insertions(+), 157 deletions(-) diff --git a/r1cs-std/src/instantiated/bls12_377/curves.rs b/r1cs-std/src/instantiated/bls12_377/curves.rs index 139ad33..0cba94f 100644 --- a/r1cs-std/src/instantiated/bls12_377/curves.rs +++ b/r1cs-std/src/instantiated/bls12_377/curves.rs @@ -1,23 +1,23 @@ use crate::groups::bls12; use algebra::bls12_377::Parameters; -pub type G1Gadget = bls12::G1Gadget; -pub type G2Gadget = bls12::G2Gadget; +pub type G1Var = bls12::G1Var; +pub type G2Var = bls12::G2Var; -pub type G1PreparedGadget = bls12::G1PreparedGadget; -pub type G2PreparedGadget = bls12::G2PreparedGadget; +pub type G1PreparedVar = bls12::G1PreparedVar; +pub type G2PreparedVar = bls12::G2PreparedVar; #[test] fn test() { use algebra::curves::models::bls12::Bls12Parameters; crate::groups::curves::short_weierstrass::test::< - _, ::G1Parameters, - G1Gadget, - >(); + G1Var, + >() + .unwrap(); crate::groups::curves::short_weierstrass::test::< - _, ::G2Parameters, - G2Gadget, - >(); + G2Var, + >() + .unwrap(); } diff --git a/r1cs-std/src/instantiated/bls12_377/fields.rs b/r1cs-std/src/instantiated/bls12_377/fields.rs index f17416d..127e362 100644 --- a/r1cs-std/src/instantiated/bls12_377/fields.rs +++ b/r1cs-std/src/instantiated/bls12_377/fields.rs @@ -1,27 +1,27 @@ use algebra::bls12_377::{Fq, Fq12Parameters, Fq2Parameters, Fq6Parameters}; -use crate::fields::{fp::FpGadget, fp12::Fp12Gadget, fp2::Fp2Gadget, fp6_3over2::Fp6Gadget}; +use crate::fields::{fp::FpVar, fp12::Fp12Var, fp2::Fp2Var, fp6_3over2::Fp6Var}; -pub type FqGadget = FpGadget; -pub type Fq2Gadget = Fp2Gadget; -pub type Fq6Gadget = Fp6Gadget; -pub type Fq12Gadget = Fp12Gadget; +pub type FqVar = FpVar; +pub type Fq2Var = Fp2Var; +pub type Fq6Var = Fp6Var; +pub type Fq12Var = Fp12Var; #[test] -fn bls12_377_field_gadgets_test() { +fn bls12_377_field_test() { use super::*; use crate::fields::tests::*; use algebra::bls12_377::{Fq, Fq12, Fq2, Fq6}; - field_test::<_, Fq, FqGadget>(); - frobenius_tests::(13); + field_test::<_, _, FqVar>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq2Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq2Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq6Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq6Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq12Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq12Var>().unwrap(); + frobenius_tests::(13).unwrap(); } diff --git a/r1cs-std/src/instantiated/bls12_377/pairing.rs b/r1cs-std/src/instantiated/bls12_377/pairing.rs index 24d6697..1258aeb 100644 --- a/r1cs-std/src/instantiated/bls12_377/pairing.rs +++ b/r1cs-std/src/instantiated/bls12_377/pairing.rs @@ -1,8 +1,8 @@ use algebra::bls12_377::Parameters; -pub type PairingGadget = crate::pairing::bls12::PairingGadget; +pub type PairingVar = crate::pairing::bls12::PairingVar; #[test] fn test() { - crate::pairing::tests::bilinearity_test::() + crate::pairing::tests::bilinearity_test::().unwrap() } diff --git a/r1cs-std/src/instantiated/ed_on_bls12_377/curves.rs b/r1cs-std/src/instantiated/ed_on_bls12_377/curves.rs index 45f6e0a..16025d1 100644 --- a/r1cs-std/src/instantiated/ed_on_bls12_377/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_bls12_377/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_bls12_377::*; -use crate::ed_on_bls12_377::FqGadget; +use crate::ed_on_bls12_377::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::<_, EdwardsParameters, EdwardsGadget>(); + crate::groups::curves::twisted_edwards::test::().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bls12_377/fields.rs b/r1cs-std/src/instantiated/ed_on_bls12_377/fields.rs index 79d0c44..18e3f93 100644 --- a/r1cs-std/src/instantiated/ed_on_bls12_377/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_bls12_377/fields.rs @@ -1,9 +1,9 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; use algebra::ed_on_bls12_377::fq::Fq; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bls12_381/curves.rs b/r1cs-std/src/instantiated/ed_on_bls12_381/curves.rs index 6ee8210..9ea8758 100644 --- a/r1cs-std/src/instantiated/ed_on_bls12_381/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_bls12_381/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_bls12_381::*; -use crate::ed_on_bls12_381::FqGadget; +use crate::ed_on_bls12_381::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::(); + crate::groups::curves::twisted_edwards::test::<_, EdwardsVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bls12_381/fields.rs b/r1cs-std/src/instantiated/ed_on_bls12_381/fields.rs index 8593477..eb9b929 100644 --- a/r1cs-std/src/instantiated/ed_on_bls12_381/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_bls12_381/fields.rs @@ -1,8 +1,8 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, algebra::ed_on_bls12_381::Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bn254/curves.rs b/r1cs-std/src/instantiated/ed_on_bn254/curves.rs index 06ab063..386acce 100644 --- a/r1cs-std/src/instantiated/ed_on_bn254/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_bn254/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_bn254::*; -use crate::ed_on_bn254::FqGadget; +use crate::ed_on_bn254::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::(); + crate::groups::curves::twisted_edwards::test::<_, EdwardsVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bn254/fields.rs b/r1cs-std/src/instantiated/ed_on_bn254/fields.rs index 5d423b7..24e65be 100644 --- a/r1cs-std/src/instantiated/ed_on_bn254/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_bn254/fields.rs @@ -1,8 +1,8 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, algebra::ed_on_bn254::Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_bw6_761/fields.rs b/r1cs-std/src/instantiated/ed_on_bw6_761/fields.rs index 66634a2..37b0972 100644 --- a/r1cs-std/src/instantiated/ed_on_bw6_761/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_bw6_761/fields.rs @@ -5,5 +5,5 @@ pub type FqGadget = FpGadget; #[test] fn test() { - crate::fields::tests::field_test::<_, Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, Fq, FqGadget>(); } diff --git a/r1cs-std/src/instantiated/ed_on_cp6_782/curves.rs b/r1cs-std/src/instantiated/ed_on_cp6_782/curves.rs index 9e661cc..df5e45a 100644 --- a/r1cs-std/src/instantiated/ed_on_cp6_782/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_cp6_782/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_cp6_782::*; -use crate::instantiated::ed_on_cp6_782::FqGadget; +use crate::instantiated::ed_on_cp6_782::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::<_, EdwardsParameters, EdwardsGadget>(); + crate::groups::curves::twisted_edwards::test::().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_cp6_782/fields.rs b/r1cs-std/src/instantiated/ed_on_cp6_782/fields.rs index 66634a2..7722ff0 100644 --- a/r1cs-std/src/instantiated/ed_on_cp6_782/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_cp6_782/fields.rs @@ -1,9 +1,9 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; use algebra::ed_on_cp6_782::fq::Fq; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_mnt4_298/curves.rs b/r1cs-std/src/instantiated/ed_on_mnt4_298/curves.rs index 1385447..5867a0c 100644 --- a/r1cs-std/src/instantiated/ed_on_mnt4_298/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_mnt4_298/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_mnt4_298::*; -use crate::instantiated::ed_on_mnt4_298::fields::FqGadget; +use crate::instantiated::ed_on_mnt4_298::fields::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::<_, EdwardsParameters, EdwardsGadget>(); + crate::groups::curves::twisted_edwards::test::().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_mnt4_298/fields.rs b/r1cs-std/src/instantiated/ed_on_mnt4_298/fields.rs index ee9052c..07128a2 100644 --- a/r1cs-std/src/instantiated/ed_on_mnt4_298/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_mnt4_298/fields.rs @@ -1,9 +1,9 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; use algebra::ed_on_mnt4_298::fq::Fq; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_mnt4_753/curves.rs b/r1cs-std/src/instantiated/ed_on_mnt4_753/curves.rs index e34a2cc..aa9b9f0 100644 --- a/r1cs-std/src/instantiated/ed_on_mnt4_753/curves.rs +++ b/r1cs-std/src/instantiated/ed_on_mnt4_753/curves.rs @@ -1,11 +1,11 @@ -use crate::groups::curves::twisted_edwards::AffineGadget; +use crate::groups::curves::twisted_edwards::AffineVar; use algebra::ed_on_mnt4_753::*; -use crate::instantiated::ed_on_mnt4_753::fields::FqGadget; +use crate::instantiated::ed_on_mnt4_753::fields::FqVar; -pub type EdwardsGadget = AffineGadget; +pub type EdwardsVar = AffineVar; #[test] fn test() { - crate::groups::curves::twisted_edwards::test::<_, EdwardsParameters, EdwardsGadget>(); + crate::groups::curves::twisted_edwards::test::().unwrap(); } diff --git a/r1cs-std/src/instantiated/ed_on_mnt4_753/fields.rs b/r1cs-std/src/instantiated/ed_on_mnt4_753/fields.rs index dc7a991..f43a823 100644 --- a/r1cs-std/src/instantiated/ed_on_mnt4_753/fields.rs +++ b/r1cs-std/src/instantiated/ed_on_mnt4_753/fields.rs @@ -1,9 +1,9 @@ -use crate::fields::fp::FpGadget; +use crate::fields::fp::FpVar; use algebra::ed_on_mnt4_753::fq::Fq; -pub type FqGadget = FpGadget; +pub type FqVar = FpVar; #[test] fn test() { - crate::fields::tests::field_test::<_, Fq, FqGadget>(); + crate::fields::tests::field_test::<_, _, FqVar>().unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt4_298/curves.rs b/r1cs-std/src/instantiated/mnt4_298/curves.rs index ae0e775..359bdcc 100644 --- a/r1cs-std/src/instantiated/mnt4_298/curves.rs +++ b/r1cs-std/src/instantiated/mnt4_298/curves.rs @@ -1,23 +1,23 @@ use crate::groups::mnt4; use algebra::mnt4_298::Parameters; -pub type G1Gadget = mnt4::G1Gadget; -pub type G2Gadget = mnt4::G2Gadget; +pub type G1Var = mnt4::G1Var; +pub type G2Var = mnt4::G2Var; -pub type G1PreparedGadget = mnt4::G1PreparedGadget; -pub type G2PreparedGadget = mnt4::G2PreparedGadget; +pub type G1PreparedVar = mnt4::G1PreparedVar; +pub type G2PreparedVar = mnt4::G2PreparedVar; #[test] fn test() { use algebra::curves::models::mnt4::MNT4Parameters; crate::groups::curves::short_weierstrass::test::< - _, ::G1Parameters, - G1Gadget, - >(); + G1Var, + >() + .unwrap(); crate::groups::curves::short_weierstrass::test::< - _, ::G2Parameters, - G2Gadget, - >(); + G2Var, + >() + .unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt4_298/fields.rs b/r1cs-std/src/instantiated/mnt4_298/fields.rs index 821cfe8..ad79f1e 100644 --- a/r1cs-std/src/instantiated/mnt4_298/fields.rs +++ b/r1cs-std/src/instantiated/mnt4_298/fields.rs @@ -1,10 +1,10 @@ use algebra::mnt4_298::{Fq, Fq2Parameters, Fq4Parameters}; -use crate::fields::{fp::FpGadget, fp2::Fp2Gadget, fp4::Fp4Gadget}; +use crate::fields::{fp::FpVar, fp2::Fp2Var, fp4::Fp4Var}; -pub type FqGadget = FpGadget; -pub type Fq2Gadget = Fp2Gadget; -pub type Fq4Gadget = Fp4Gadget; +pub type FqVar = FpVar; +pub type Fq2Var = Fp2Var; +pub type Fq4Var = Fp4Var; #[test] fn mnt4_298_field_gadgets_test() { @@ -12,12 +12,12 @@ fn mnt4_298_field_gadgets_test() { use crate::fields::tests::*; use algebra::mnt4_298::{Fq, Fq2, Fq4}; - field_test::<_, Fq, FqGadget>(); - frobenius_tests::(13); + field_test::<_, _, FqVar>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq2Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq2Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq4Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq4Var>().unwrap(); + frobenius_tests::(13).unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt4_298/pairing.rs b/r1cs-std/src/instantiated/mnt4_298/pairing.rs index a64c4ec..768e73e 100644 --- a/r1cs-std/src/instantiated/mnt4_298/pairing.rs +++ b/r1cs-std/src/instantiated/mnt4_298/pairing.rs @@ -1,8 +1,8 @@ use algebra::mnt4_298::Parameters; -pub type PairingGadget = crate::pairing::mnt4::PairingGadget; +pub type PairingVar = crate::pairing::mnt4::PairingVar; #[test] fn test() { - crate::pairing::tests::bilinearity_test::() + crate::pairing::tests::bilinearity_test::().unwrap() } diff --git a/r1cs-std/src/instantiated/mnt4_753/curves.rs b/r1cs-std/src/instantiated/mnt4_753/curves.rs index 0927e52..4f83b8e 100644 --- a/r1cs-std/src/instantiated/mnt4_753/curves.rs +++ b/r1cs-std/src/instantiated/mnt4_753/curves.rs @@ -1,23 +1,23 @@ use crate::groups::mnt4; use algebra::mnt4_753::Parameters; -pub type G1Gadget = mnt4::G1Gadget; -pub type G2Gadget = mnt4::G2Gadget; +pub type G1Var = mnt4::G1Var; +pub type G2Var = mnt4::G2Var; -pub type G1PreparedGadget = mnt4::G1PreparedGadget; -pub type G2PreparedGadget = mnt4::G2PreparedGadget; +pub type G1PreparedVar = mnt4::G1PreparedVar; +pub type G2PreparedVar = mnt4::G2PreparedVar; #[test] fn test() { use algebra::curves::models::mnt4::MNT4Parameters; crate::groups::curves::short_weierstrass::test::< - _, ::G1Parameters, - G1Gadget, - >(); + G1Var, + >() + .unwrap(); crate::groups::curves::short_weierstrass::test::< - _, ::G2Parameters, - G2Gadget, - >(); + G2Var, + >() + .unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt4_753/fields.rs b/r1cs-std/src/instantiated/mnt4_753/fields.rs index bb3bce9..5cc960e 100644 --- a/r1cs-std/src/instantiated/mnt4_753/fields.rs +++ b/r1cs-std/src/instantiated/mnt4_753/fields.rs @@ -1,10 +1,10 @@ use algebra::mnt4_753::{Fq, Fq2Parameters, Fq4Parameters}; -use crate::fields::{fp::FpGadget, fp2::Fp2Gadget, fp4::Fp4Gadget}; +use crate::fields::{fp::FpVar, fp2::Fp2Var, fp4::Fp4Var}; -pub type FqGadget = FpGadget; -pub type Fq2Gadget = Fp2Gadget; -pub type Fq4Gadget = Fp4Gadget; +pub type FqVar = FpVar; +pub type Fq2Var = Fp2Var; +pub type Fq4Var = Fp4Var; #[test] fn mnt4_753_field_gadgets_test() { @@ -12,12 +12,12 @@ fn mnt4_753_field_gadgets_test() { use crate::fields::tests::*; use algebra::mnt4_753::{Fq, Fq2, Fq4}; - field_test::<_, Fq, FqGadget>(); - frobenius_tests::(13); + field_test::<_, _, FqVar>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq2Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq2Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq4Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq4Var>().unwrap(); + frobenius_tests::(13).unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt4_753/pairing.rs b/r1cs-std/src/instantiated/mnt4_753/pairing.rs index a0edc54..43e7a78 100644 --- a/r1cs-std/src/instantiated/mnt4_753/pairing.rs +++ b/r1cs-std/src/instantiated/mnt4_753/pairing.rs @@ -1,8 +1,8 @@ use algebra::mnt4_753::Parameters; -pub type PairingGadget = crate::pairing::mnt4::PairingGadget; +pub type PairingVar = crate::pairing::mnt4::PairingVar; #[test] fn test() { - crate::pairing::tests::bilinearity_test::() + crate::pairing::tests::bilinearity_test::().unwrap() } diff --git a/r1cs-std/src/instantiated/mnt6_298/curves.rs b/r1cs-std/src/instantiated/mnt6_298/curves.rs index c92acce..4741888 100644 --- a/r1cs-std/src/instantiated/mnt6_298/curves.rs +++ b/r1cs-std/src/instantiated/mnt6_298/curves.rs @@ -1,23 +1,23 @@ use crate::groups::mnt6; use algebra::mnt6_298::Parameters; -pub type G1Gadget = mnt6::G1Gadget; -pub type G2Gadget = mnt6::G2Gadget; +pub type G1Var = mnt6::G1Var; +pub type G2Var = mnt6::G2Var; -pub type G1PreparedGadget = mnt6::G1PreparedGadget; -pub type G2PreparedGadget = mnt6::G2PreparedGadget; +pub type G1PreparedVar = mnt6::G1PreparedVar; +pub type G2PreparedVar = mnt6::G2PreparedVar; #[test] fn test() { use algebra::curves::models::mnt6::MNT6Parameters; crate::groups::curves::short_weierstrass::test::< - _, ::G1Parameters, - G1Gadget, - >(); + G1Var, + >() + .unwrap(); crate::groups::curves::short_weierstrass::test::< - _, ::G2Parameters, - G2Gadget, - >(); + G2Var, + >() + .unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt6_298/fields.rs b/r1cs-std/src/instantiated/mnt6_298/fields.rs index 77d26dd..8ef8c61 100644 --- a/r1cs-std/src/instantiated/mnt6_298/fields.rs +++ b/r1cs-std/src/instantiated/mnt6_298/fields.rs @@ -1,10 +1,10 @@ use algebra::mnt6_298::{Fq, Fq3Parameters, Fq6Parameters}; -use crate::fields::{fp::FpGadget, fp3::Fp3Gadget, fp6_2over3::Fp6Gadget}; +use crate::fields::{fp::FpVar, fp3::Fp3Var, fp6_2over3::Fp6Var}; -pub type FqGadget = FpGadget; -pub type Fq3Gadget = Fp3Gadget; -pub type Fq6Gadget = Fp6Gadget; +pub type FqVar = FpVar; +pub type Fq3Var = Fp3Var; +pub type Fq6Var = Fp6Var; #[test] fn mnt6_298_field_gadgets_test() { @@ -12,12 +12,12 @@ fn mnt6_298_field_gadgets_test() { use crate::fields::tests::*; use algebra::mnt6_298::{Fq, Fq3, Fq6}; - field_test::<_, Fq, FqGadget>(); - frobenius_tests::(13); + field_test::<_, _, FqVar>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq3Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq3Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq6Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq6Var>().unwrap(); + frobenius_tests::(13).unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt6_298/pairing.rs b/r1cs-std/src/instantiated/mnt6_298/pairing.rs index 58e3a71..0d3af87 100644 --- a/r1cs-std/src/instantiated/mnt6_298/pairing.rs +++ b/r1cs-std/src/instantiated/mnt6_298/pairing.rs @@ -1,8 +1,8 @@ use algebra::mnt6_298::Parameters; -pub type PairingGadget = crate::pairing::mnt6::PairingGadget; +pub type PairingVar = crate::pairing::mnt6::PairingVar; #[test] fn test() { - crate::pairing::tests::bilinearity_test::() + crate::pairing::tests::bilinearity_test::().unwrap() } diff --git a/r1cs-std/src/instantiated/mnt6_753/curves.rs b/r1cs-std/src/instantiated/mnt6_753/curves.rs index f41c22a..3b2c273 100644 --- a/r1cs-std/src/instantiated/mnt6_753/curves.rs +++ b/r1cs-std/src/instantiated/mnt6_753/curves.rs @@ -1,23 +1,23 @@ use crate::groups::mnt6; use algebra::mnt6_753::Parameters; -pub type G1Gadget = mnt6::G1Gadget; -pub type G2Gadget = mnt6::G2Gadget; +pub type G1Var = mnt6::G1Var; +pub type G2Var = mnt6::G2Var; -pub type G1PreparedGadget = mnt6::G1PreparedGadget; -pub type G2PreparedGadget = mnt6::G2PreparedGadget; +pub type G1PreparedVar = mnt6::G1PreparedVar; +pub type G2PreparedVar = mnt6::G2PreparedVar; #[test] fn test() { use algebra::curves::models::mnt6::MNT6Parameters; crate::groups::curves::short_weierstrass::test::< - _, ::G1Parameters, - G1Gadget, - >(); + G1Var, + >() + .unwrap(); crate::groups::curves::short_weierstrass::test::< - _, ::G2Parameters, - G2Gadget, - >(); + G2Var, + >() + .unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt6_753/fields.rs b/r1cs-std/src/instantiated/mnt6_753/fields.rs index 1fc715e..3cbea4c 100644 --- a/r1cs-std/src/instantiated/mnt6_753/fields.rs +++ b/r1cs-std/src/instantiated/mnt6_753/fields.rs @@ -1,10 +1,10 @@ use algebra::mnt6_753::{Fq, Fq3Parameters, Fq6Parameters}; -use crate::fields::{fp::FpGadget, fp3::Fp3Gadget, fp6_2over3::Fp6Gadget}; +use crate::fields::{fp::FpVar, fp3::Fp3Var, fp6_2over3::Fp6Var}; -pub type FqGadget = FpGadget; -pub type Fq3Gadget = Fp3Gadget; -pub type Fq6Gadget = Fp6Gadget; +pub type FqVar = FpVar; +pub type Fq3Var = Fp3Var; +pub type Fq6Var = Fp6Var; #[test] fn mnt6_753_field_gadgets_test() { @@ -12,12 +12,12 @@ fn mnt6_753_field_gadgets_test() { use crate::fields::tests::*; use algebra::mnt6_753::{Fq, Fq3, Fq6}; - field_test::<_, Fq, FqGadget>(); - frobenius_tests::(13); + field_test::<_, _, FqVar>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq3Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq3Var>().unwrap(); + frobenius_tests::(13).unwrap(); - field_test::<_, Fq, Fq6Gadget>(); - frobenius_tests::(13); + field_test::<_, _, Fq6Var>().unwrap(); + frobenius_tests::(13).unwrap(); } diff --git a/r1cs-std/src/instantiated/mnt6_753/pairing.rs b/r1cs-std/src/instantiated/mnt6_753/pairing.rs index df93d07..9d39c73 100644 --- a/r1cs-std/src/instantiated/mnt6_753/pairing.rs +++ b/r1cs-std/src/instantiated/mnt6_753/pairing.rs @@ -1,8 +1,8 @@ use algebra::mnt6_753::Parameters; -pub type PairingGadget = crate::pairing::mnt6::PairingGadget; +pub type PairingVar = crate::pairing::mnt6::PairingVar; #[test] fn test() { - crate::pairing::tests::bilinearity_test::() + crate::pairing::tests::bilinearity_test::().unwrap() }