mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 14:13:46 +01:00
Add constraints for relevant curves (#3)
This commit is contained in:
29
bls12_377/src/constraints/curves.rs
Normal file
29
bls12_377/src/constraints/curves.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use crate::Parameters;
|
||||
use ark_r1cs_std::groups::bls12;
|
||||
|
||||
/// An element of G1 in the BLS12-377 bilinear group.
|
||||
pub type G1Var = bls12::G1Var<Parameters>;
|
||||
/// An element of G2 in the BLS12-377 bilinear group.
|
||||
pub type G2Var = bls12::G2Var<Parameters>;
|
||||
|
||||
/// Represents the cached precomputation that can be performed on a G1 element
|
||||
/// which enables speeding up pairing computation.
|
||||
pub type G1PreparedVar = bls12::G1PreparedVar<Parameters>;
|
||||
/// Represents the cached precomputation that can be performed on a G2 element
|
||||
/// which enables speeding up pairing computation.
|
||||
pub type G2PreparedVar = bls12::G2PreparedVar<Parameters>;
|
||||
|
||||
#[test]
|
||||
fn test() {
|
||||
use ark_ec::models::bls12::Bls12Parameters;
|
||||
ark_curve_constraint_tests::curves::sw_test::<
|
||||
<Parameters as Bls12Parameters>::G1Parameters,
|
||||
G1Var,
|
||||
>()
|
||||
.unwrap();
|
||||
ark_curve_constraint_tests::curves::sw_test::<
|
||||
<Parameters as Bls12Parameters>::G2Parameters,
|
||||
G2Var,
|
||||
>()
|
||||
.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user