Update concrete curves in r1cs-std.

This commit is contained in:
Pratyush Mishra
2020-08-24 00:47:21 -07:00
parent 26953045d4
commit 50388bdc22
28 changed files with 157 additions and 157 deletions

View File

@@ -1,23 +1,23 @@
use crate::groups::mnt4;
use algebra::mnt4_298::Parameters;
pub type G1Gadget = mnt4::G1Gadget<Parameters>;
pub type G2Gadget = mnt4::G2Gadget<Parameters>;
pub type G1Var = mnt4::G1Var<Parameters>;
pub type G2Var = mnt4::G2Var<Parameters>;
pub type G1PreparedGadget = mnt4::G1PreparedGadget<Parameters>;
pub type G2PreparedGadget = mnt4::G2PreparedGadget<Parameters>;
pub type G1PreparedVar = mnt4::G1PreparedVar<Parameters>;
pub type G2PreparedVar = mnt4::G2PreparedVar<Parameters>;
#[test]
fn test() {
use algebra::curves::models::mnt4::MNT4Parameters;
crate::groups::curves::short_weierstrass::test::<
_,
<Parameters as MNT4Parameters>::G1Parameters,
G1Gadget,
>();
G1Var,
>()
.unwrap();
crate::groups::curves::short_weierstrass::test::<
_,
<Parameters as MNT4Parameters>::G2Parameters,
G2Gadget,
>();
G2Var,
>()
.unwrap();
}

View File

@@ -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<Fq>;
pub type Fq2Gadget = Fp2Gadget<Fq2Parameters, Fq>;
pub type Fq4Gadget = Fp4Gadget<Fq4Parameters, Fq>;
pub type FqVar = FpVar<Fq>;
pub type Fq2Var = Fp2Var<Fq2Parameters>;
pub type Fq4Var = Fp4Var<Fq4Parameters>;
#[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::<Fq, Fq, FqGadget>(13);
field_test::<_, _, FqVar>().unwrap();
frobenius_tests::<Fq, _, FqVar>(13).unwrap();
field_test::<_, Fq, Fq2Gadget>();
frobenius_tests::<Fq2, Fq, Fq2Gadget>(13);
field_test::<_, _, Fq2Var>().unwrap();
frobenius_tests::<Fq2, _, Fq2Var>(13).unwrap();
field_test::<_, Fq, Fq4Gadget>();
frobenius_tests::<Fq4, Fq, Fq4Gadget>(13);
field_test::<_, _, Fq4Var>().unwrap();
frobenius_tests::<Fq4, _, Fq4Var>(13).unwrap();
}

View File

@@ -1,8 +1,8 @@
use algebra::mnt4_298::Parameters;
pub type PairingGadget = crate::pairing::mnt4::PairingGadget<Parameters>;
pub type PairingVar = crate::pairing::mnt4::PairingVar<Parameters>;
#[test]
fn test() {
crate::pairing::tests::bilinearity_test::<algebra::MNT4_298, _, PairingGadget>()
crate::pairing::tests::bilinearity_test::<algebra::MNT4_298, PairingVar>().unwrap()
}