* Rename all `*Parameters` to `*Config` * Tweakcherry-pick
@ -1,45 +1,39 @@ |
|||
use ark_ec::{bls12::Bls12Parameters, CurveConfig};
|
|||
use ark_ec::{bls12::Bls12Config, CurveConfig};
|
|||
use ark_r1cs_std::{
|
|||
fields::fp::FpVar,
|
|||
groups::{bls12, curves::twisted_edwards::AffineVar as TEAffineVar},
|
|||
};
|
|||
|
|||
use crate::Parameters;
|
|||
use crate::Config;
|
|||
|
|||
/// An element of G1 in the BLS12-377 bilinear group.
|
|||
pub type G1Var = bls12::G1Var<Parameters>;
|
|||
pub type G1Var = bls12::G1Var<Config>;
|
|||
/// An element of G2 in the BLS12-377 bilinear group.
|
|||
pub type G2Var = bls12::G2Var<Parameters>;
|
|||
pub type G2Var = bls12::G2Var<Config>;
|
|||
|
|||
/// An element of G1 (in TE Affine form) in the BLS12-377 bilinear group.
|
|||
pub type G1TEAffineVar = TEAffineVar<
|
|||
<Parameters as Bls12Parameters>::G1Parameters,
|
|||
FpVar<<<Parameters as Bls12Parameters>::G1Parameters as CurveConfig>::BaseField>,
|
|||
<Config as Bls12Config>::G1Config,
|
|||
FpVar<<<Config as Bls12Config>::G1Config as CurveConfig>::BaseField>,
|
|||
>;
|
|||
|
|||
/// Represents the cached precomputation that can be performed on a G1 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G1PreparedVar = bls12::G1PreparedVar<Parameters>;
|
|||
pub type G1PreparedVar = bls12::G1PreparedVar<Config>;
|
|||
/// Represents the cached precomputation that can be performed on a G2 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G2PreparedVar = bls12::G2PreparedVar<Parameters>;
|
|||
pub type G2PreparedVar = bls12::G2PreparedVar<Config>;
|
|||
|
|||
#[test]
|
|||
fn test() {
|
|||
use ark_ec::models::bls12::Bls12Parameters;
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as Bls12Parameters>::G1Parameters,
|
|||
G1Var,
|
|||
>()
|
|||
.unwrap();
|
|||
use ark_ec::models::bls12::Bls12Config;
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as Bls12Config>::G1Config, G1Var>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::te_test::<
|
|||
<Parameters as Bls12Parameters>::G1Parameters,
|
|||
<Config as Bls12Config>::G1Config,
|
|||
G1TEAffineVar,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as Bls12Parameters>::G2Parameters,
|
|||
G2Var,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as Bls12Config>::G2Config, G2Var>()
|
|||
.unwrap();
|
|||
}
|
@ -1,30 +1,24 @@ |
|||
use ark_r1cs_std::groups::mnt4;
|
|||
|
|||
use crate::Parameters;
|
|||
use crate::Config;
|
|||
|
|||
/// An element of G1 in the MNT4-298 bilinear group.
|
|||
pub type G1Var = mnt4::G1Var<Parameters>;
|
|||
pub type G1Var = mnt4::G1Var<Config>;
|
|||
/// An element of G2 in the MNT4-298 bilinear group.
|
|||
pub type G2Var = mnt4::G2Var<Parameters>;
|
|||
pub type G2Var = mnt4::G2Var<Config>;
|
|||
|
|||
/// Represents the cached precomputation that can be performed on a G1 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G1PreparedVar = mnt4::G1PreparedVar<Parameters>;
|
|||
pub type G1PreparedVar = mnt4::G1PreparedVar<Config>;
|
|||
/// Represents the cached precomputation that can be performed on a G2 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G2PreparedVar = mnt4::G2PreparedVar<Parameters>;
|
|||
pub type G2PreparedVar = mnt4::G2PreparedVar<Config>;
|
|||
|
|||
#[test]
|
|||
fn test() {
|
|||
use ark_ec::models::mnt4::MNT4Parameters;
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT4Parameters>::G1Parameters,
|
|||
G1Var,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT4Parameters>::G2Parameters,
|
|||
G2Var,
|
|||
>()
|
|||
.unwrap();
|
|||
use ark_ec::models::mnt4::MNT4Config;
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT4Config>::G1Config, G1Var>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT4Config>::G2Config, G2Var>()
|
|||
.unwrap();
|
|||
}
|
@ -1,30 +1,24 @@ |
|||
use ark_r1cs_std::groups::mnt4;
|
|||
|
|||
use crate::Parameters;
|
|||
use crate::Config;
|
|||
|
|||
/// An element of G1 in the MNT4-753 bilinear group.
|
|||
pub type G1Var = mnt4::G1Var<Parameters>;
|
|||
pub type G1Var = mnt4::G1Var<Config>;
|
|||
/// An element of G2 in the MNT4-753 bilinear group.
|
|||
pub type G2Var = mnt4::G2Var<Parameters>;
|
|||
pub type G2Var = mnt4::G2Var<Config>;
|
|||
|
|||
/// Represents the cached precomputation that can be performed on a G1 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G1PreparedVar = mnt4::G1PreparedVar<Parameters>;
|
|||
pub type G1PreparedVar = mnt4::G1PreparedVar<Config>;
|
|||
/// Represents the cached precomputation that can be performed on a G2 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G2PreparedVar = mnt4::G2PreparedVar<Parameters>;
|
|||
pub type G2PreparedVar = mnt4::G2PreparedVar<Config>;
|
|||
|
|||
#[test]
|
|||
fn test() {
|
|||
use ark_ec::models::mnt4::MNT4Parameters;
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT4Parameters>::G1Parameters,
|
|||
G1Var,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT4Parameters>::G2Parameters,
|
|||
G2Var,
|
|||
>()
|
|||
.unwrap();
|
|||
use ark_ec::models::mnt4::MNT4Config;
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT4Config>::G1Config, G1Var>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT4Config>::G2Config, G2Var>()
|
|||
.unwrap();
|
|||
}
|
@ -1,30 +1,24 @@ |
|||
use ark_r1cs_std::groups::mnt6;
|
|||
|
|||
use crate::Parameters;
|
|||
use crate::Config;
|
|||
|
|||
/// An element of G1 in the MNT6-298 bilinear group.
|
|||
pub type G1Var = mnt6::G1Var<Parameters>;
|
|||
pub type G1Var = mnt6::G1Var<Config>;
|
|||
/// An element of G2 in the MNT6-298 bilinear group.
|
|||
pub type G2Var = mnt6::G2Var<Parameters>;
|
|||
pub type G2Var = mnt6::G2Var<Config>;
|
|||
|
|||
/// Represents the cached precomputation that can be performed on a G1 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G1PreparedVar = mnt6::G1PreparedVar<Parameters>;
|
|||
pub type G1PreparedVar = mnt6::G1PreparedVar<Config>;
|
|||
/// Represents the cached precomputation that can be performed on a G2 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G2PreparedVar = mnt6::G2PreparedVar<Parameters>;
|
|||
pub type G2PreparedVar = mnt6::G2PreparedVar<Config>;
|
|||
|
|||
#[test]
|
|||
fn test() {
|
|||
use ark_ec::models::mnt6::MNT6Parameters;
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT6Parameters>::G1Parameters,
|
|||
G1Var,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT6Parameters>::G2Parameters,
|
|||
G2Var,
|
|||
>()
|
|||
.unwrap();
|
|||
use ark_ec::models::mnt6::MNT6Config;
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT6Config>::G1Config, G1Var>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT6Config>::G2Config, G2Var>()
|
|||
.unwrap();
|
|||
}
|
@ -1,30 +1,24 @@ |
|||
use ark_r1cs_std::groups::mnt6;
|
|||
|
|||
use crate::Parameters;
|
|||
use crate::Config;
|
|||
|
|||
/// An element of G1 in the MNT6-753 bilinear group.
|
|||
pub type G1Var = mnt6::G1Var<Parameters>;
|
|||
pub type G1Var = mnt6::G1Var<Config>;
|
|||
/// An element of G2 in the MNT6-753 bilinear group.
|
|||
pub type G2Var = mnt6::G2Var<Parameters>;
|
|||
pub type G2Var = mnt6::G2Var<Config>;
|
|||
|
|||
/// Represents the cached precomputation that can be performed on a G1 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G1PreparedVar = mnt6::G1PreparedVar<Parameters>;
|
|||
pub type G1PreparedVar = mnt6::G1PreparedVar<Config>;
|
|||
/// Represents the cached precomputation that can be performed on a G2 element
|
|||
/// which enables speeding up pairing computation.
|
|||
pub type G2PreparedVar = mnt6::G2PreparedVar<Parameters>;
|
|||
pub type G2PreparedVar = mnt6::G2PreparedVar<Config>;
|
|||
|
|||
#[test]
|
|||
fn test() {
|
|||
use ark_ec::models::mnt6::MNT6Parameters;
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT6Parameters>::G1Parameters,
|
|||
G1Var,
|
|||
>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<
|
|||
<Parameters as MNT6Parameters>::G2Parameters,
|
|||
G2Var,
|
|||
>()
|
|||
.unwrap();
|
|||
use ark_ec::models::mnt6::MNT6Config;
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT6Config>::G1Config, G1Var>()
|
|||
.unwrap();
|
|||
ark_curve_constraint_tests::curves::sw_test::<<Config as MNT6Config>::G2Config, G2Var>()
|
|||
.unwrap();
|
|||
}
|