Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ec model files and curve struct names #438

Merged
merged 4 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
- [\#348](https://github.com/arkworks-rs/algebra/pull/348) (`ark-ec`) Rename `msm:{Fixed,Variable}BaseMSM:multi_scalar_mul` to `msm:{Fixed,Variable}:msm` to avoid redundancy.
- [\#359](https://github.com/arkworks-rs/algebra/pull/359) (`ark-test-templates`) Simplify the field and curve test macros.
- [\#365](https://github.com/arkworks-rs/algebra/pull/365) (`ark-ec`)
- Move `COFACTOR`, `COFACTOR_INV`, and `is_in_correct_subgroup_assuming_on_curve()` from `{SW,TE}ModelParameters` to `ModelParameters`.
- Move `COFACTOR`, `COFACTOR_INV`, and `is_in_correct_subgroup_assuming_on_curve()` from `{SW,TE}CurveConfig` to `CurveConfig`.
- Add `mul_bits()` to `AffineCurve` and provide a default implementation of `mul()` using this.
- Remove duplicate function `scale_by_cofactor()` from `short_weierstrass_jacobian::GroupAffine` and `twisted_edwards_extended::GroupAffine`
- Remove duplicate function `scale_by_cofactor()` from `short_weierstrass::GroupAffine` and `twisted_edwards_extended::GroupAffine`
- [\#370](https://github.com/arkworks-rs/algebra/pull/370) (all) Set the minimum `rust-version = 1.56` in the manifests of all crates.
- [\#379](https://github.com/arkworks-rs/algebra/pull/379) (`ark-ff`) Refactor `Field` implementation and `PrimeField` trait:
- Switch from hardcoded `FpXYZ` to `Fp<N>` based on `const` generics.
Expand All @@ -35,18 +35,27 @@
- [\#412](https://github.com/arkworks-rs/algebra/pull/412) (`ark-poly`) Rename UV/MVPolynomial to DenseUV/MVPolynomial.
- [\#417](https://github.com/arkworks-rs/algebra/pull/417) (`ark-ff`) Remove `ToBytes` and `FromBytes`.
- [\#425](https://github.com/arkworks-rs/algebra/pull/425) (`ark-ec`) Refactor `VariableBase` struct to `VariableBaseMSM` trait and implement it for `GroupProjective`.
- [\#438](https://github.com/arkworks-rs/algebra/pull/438) (`ark-ec`) Rename modules, structs, and traits related to `ec`.
- `short_weierstrass_jacobian` → `short_weierstrass`
- `twisted_edwards_extend` → `twisted_edwards`
- `GroupAffine` → `Affine`
- `GroupProjective` → `Projective`
- `ModelParameters` → `CurveConfig`
- `SWModelParameters` → `SWCurveConfig`
- `TEModelParameters` → `TECurveConfig`
- `MontgomeryModelParameters` → `MontCurveConfig`

### Features

- [\#301](https://github.com/arkworks-rs/algebra/pull/301) (`ark-ec`) Add `GLVParameters` trait definition.
- [\#312](https://github.com/arkworks-rs/algebra/pull/312) (`ark-ec`) Add `is_in_correct_subgroup_assuming_on_curve` for all `SWModelParameters`.
- [\#312](https://github.com/arkworks-rs/algebra/pull/312) (`ark-ec`) Add `is_in_correct_subgroup_assuming_on_curve` for all `Parameters`.
- [\#321](https://github.com/arkworks-rs/algebra/pull/321) (`ark-ff`) Change bigint conversions to impl `From` instead of `Into`.
- [\#343](https://github.com/arkworks-rs/algebra/pull/343) (`ark-ec`) Add WB and SWU hash-to-curve maps.
- [\#348](https://github.com/arkworks-rs/algebra/pull/348) (`ark-ec`) Add `msm:{Fixed,Variable}Base:msm_checked_len`.
- [\#364](https://github.com/arkworks-rs/algebra/pull/364) (`ark-ec`) Add `ChunkedPippenger` to variable-base MSM.
- [\#371](https://github.com/arkworks-rs/algebra/pull/371) (`ark-serialize`) Add serialization impls for arrays
- [\#386](https://github.com/arkworks-rs/algebra/pull/386) (`ark-ff-macros`, `ark-ff`) Add a macro to derive `MontConfig`.
- [\#396](https://github.com/arkworks-rs/algebra/pull/396) (`ark-ec`) Add a default `mul` function to `{TE,SW}ModelParameters` trait definition.
- [\#396](https://github.com/arkworks-rs/algebra/pull/396) (`ark-ec`) Add a default `mul` function to `{TE,SW}CurveConfig` trait definition.
- [\#397](https://github.com/arkworks-rs/algebra/pull/397) (`ark-ec`) Add `HashMapPippenger` to variable-base MSM.
- [\#420](https://github.com/arkworks-rs/algebra/pull/420) (`ark-ec`) Add a `clear_cofactor` method to `AffineCurve`.

Expand Down
4 changes: 2 additions & 2 deletions ec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ The available elliptic curve traits are:

The elliptic curve models implemented are:

* [*Short Weierstrass*](https://github.com/arkworks-rs/algebra/blob/master/ec/src/models/short_weierstrass_jacobian.rs) curves. The `AffineCurve` in this case is in typical Short Weierstrass point representation, and the `ProjectiveCurve` is using points in [Jacobian Coordinates](https://en.wikibooks.org/wiki/Cryptography/Prime_Curve/Jacobian_Coordinates).
* [*Twisted Edwards*](https://github.com/arkworks-rs/algebra/blob/master/ec/src/models/twisted_edwards_extended.rs) curves. The `AffineCurve` in this case is in standard Twisted Edwards curve representation, whereas the `ProjectiveCurve` uses points in [Extended Twisted Edwards Coordinates](https://eprint.iacr.org/2008/522.pdf).
* [*Short Weierstrass*](https://github.com/arkworks-rs/algebra/blob/master/ec/src/models/short_weierstrass.rs) curves. The `AffineCurve` in this case is in typical Short Weierstrass point representation, and the `ProjectiveCurve` is using points in [Jacobian Coordinates](https://en.wikibooks.org/wiki/Cryptography/Prime_Curve/Jacobian_Coordinates).
* [*Twisted Edwards*](https://github.com/arkworks-rs/algebra/blob/master/ec/src/models/twisted_edwards.rs) curves. The `AffineCurve` in this case is in standard Twisted Edwards curve representation, whereas the `ProjectiveCurve` uses points in [Extended Twisted Edwards Coordinates](https://eprint.iacr.org/2008/522.pdf).
4 changes: 2 additions & 2 deletions ec/src/glv.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::ModelParameters;
use crate::CurveConfig;

/// The GLV parameters for computing the endomorphism and scalar decomposition.
pub trait GLVParameters: Send + Sync + 'static + ModelParameters {
pub trait GLVParameters: Send + Sync + 'static + CurveConfig {
/// Affine representation of curve points.
type CurveAffine;
/// A representation of curve points that enables efficient arithmetic by
Expand Down
12 changes: 6 additions & 6 deletions ec/src/hashing/curve_maps/swu/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
use crate::models::SWModelParameters;
use crate::models::short_weierstrass::SWCurveConfig;
use ark_ff::{BigInteger, Field, One, PrimeField, SquareRootField, Zero};
use ark_std::string::ToString;
use core::marker::PhantomData;

use crate::{
hashing::{map_to_curve_hasher::MapToCurve, HashToCurveError},
models::short_weierstrass_jacobian::GroupAffine,
models::short_weierstrass::Affine,
};

/// Trait defining the necessary parameters for the SWU hash-to-curve method
/// for the curves of Weierstrass form of:
/// y^2 = x^3 + a*x + b where ab != 0. From [\[WB2019\]]
///
/// - [\[WB2019\]] <https://eprint.iacr.org/2019/403>
pub trait SWUParams: SWModelParameters {
pub trait SWUParams: SWCurveConfig {
/// An element of the base field that is not a square root see \[WB2019, Section 4\].
/// It is also convenient to have $g(b/xi * a)$ to be square. In general
/// we use a `XI` with low absolute value coefficients when they are
Expand All @@ -40,7 +40,7 @@ pub fn parity<F: Field>(element: &F) -> bool {
.map_or(false, |x| x.into_bigint().is_odd())
}

impl<P: SWUParams> MapToCurve<GroupAffine<P>> for SWUMap<P> {
impl<P: SWUParams> MapToCurve<Affine<P>> for SWUMap<P> {
/// Constructs a new map if `P` represents a valid map.
fn new() -> Result<Self, HashToCurveError> {
// Verifying that both XI and ZETA are non-squares
Expand Down Expand Up @@ -81,7 +81,7 @@ impl<P: SWUParams> MapToCurve<GroupAffine<P>> for SWUMap<P> {
/// Map an arbitrary base field element to a curve point.
/// Based on
/// <https://github.com/zcash/pasta_curves/blob/main/src/hashtocurve.rs>.
fn map_to_curve(&self, point: P::BaseField) -> Result<GroupAffine<P>, HashToCurveError> {
fn map_to_curve(&self, point: P::BaseField) -> Result<Affine<P>, HashToCurveError> {
// 1. tv1 = inv0(Z^2 * u^4 + Z * u^2)
// 2. x1 = (-B / A) * (1 + tv1)
// 3. If tv1 == 0, set x1 = B / (Z * A)
Expand Down Expand Up @@ -165,7 +165,7 @@ impl<P: SWUParams> MapToCurve<GroupAffine<P>> for SWUMap<P> {

let x_affine = num_x / div;
let y_affine = if parity(&y) { -y } else { y };
let point_on_curve = GroupAffine::<P>::new(x_affine, y_affine, false);
let point_on_curve = Affine::<P>::new(x_affine, y_affine, false);
assert!(
point_on_curve.is_on_curve(),
"swu mapped to a point off the curve"
Expand Down
22 changes: 11 additions & 11 deletions ec/src/hashing/curve_maps/wb/mod.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
use core::marker::PhantomData;

use crate::{models::SWModelParameters, ModelParameters};
use crate::{models::short_weierstrass::SWCurveConfig, CurveConfig};
use ark_ff::batch_inversion;
use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial, Polynomial};

use crate::{
hashing::{map_to_curve_hasher::MapToCurve, HashToCurveError},
models::short_weierstrass_jacobian::GroupAffine,
models::short_weierstrass::Affine,
AffineCurve,
};

use super::swu::{SWUMap, SWUParams};
type BaseField<MP> = <MP as ModelParameters>::BaseField;
type BaseField<MP> = <MP as CurveConfig>::BaseField;

/// Trait defining the necessary parameters for the WB hash-to-curve method
/// for the curves of Weierstrass form of:
/// of y^2 = x^3 + a*x + b where b != 0 but `a` can be zero like BLS-381 curve.
/// From [\[WB2019\]]
///
/// - [\[WB2019\]] <http://dx.doi.org/10.46586/tches.v2019.i4.154-179>
pub trait WBParams: SWModelParameters + Sized {
pub trait WBParams: SWCurveConfig + Sized {
// The isogenous curve should be defined over the same base field but it can have
// different scalar field type IsogenousCurveScalarField :
type IsogenousCurve: SWUParams<BaseField = BaseField<Self>>;
Expand All @@ -31,8 +31,8 @@ pub trait WBParams: SWModelParameters + Sized {
const PHI_Y_DEN: &'static [BaseField<Self>];

fn isogeny_map(
domain_point: GroupAffine<Self::IsogenousCurve>,
) -> Result<GroupAffine<Self>, HashToCurveError> {
domain_point: Affine<Self::IsogenousCurve>,
) -> Result<Affine<Self>, HashToCurveError> {
let x_num = DensePolynomial::from_coefficients_slice(Self::PHI_X_NOM);
let x_den = DensePolynomial::from_coefficients_slice(Self::PHI_X_DEN);

Expand All @@ -47,7 +47,7 @@ pub trait WBParams: SWModelParameters + Sized {
let img_x = x_num.evaluate(&domain_point.x) * v[0];
let img_y = (y_num.evaluate(&domain_point.x) * domain_point.y) * v[1];

Ok(GroupAffine::new(img_x, img_y, false))
Ok(Affine::new(img_x, img_y, false))
}
}

Expand All @@ -56,11 +56,11 @@ pub struct WBMap<P: WBParams> {
curve_params: PhantomData<fn() -> P>,
}

impl<P: WBParams> MapToCurve<GroupAffine<P>> for WBMap<P> {
impl<P: WBParams> MapToCurve<Affine<P>> for WBMap<P> {
/// Constructs a new map if `P` represents a valid map.
fn new() -> Result<Self, HashToCurveError> {
// Verifying that the isogeny maps the generator of the SWU curve into us
let isogenous_curve_generator = GroupAffine::<P::IsogenousCurve>::new(
let isogenous_curve_generator = Affine::<P::IsogenousCurve>::new(
P::IsogenousCurve::AFFINE_GENERATOR_COEFFS.0,
P::IsogenousCurve::AFFINE_GENERATOR_COEFFS.1,
false,
Expand All @@ -86,8 +86,8 @@ impl<P: WBParams> MapToCurve<GroupAffine<P>> for WBMap<P> {
/// <https://github.com/zcash/pasta_curves/blob/main/src/hashtocurve.rs>
fn map_to_curve(
&self,
element: <GroupAffine<P> as AffineCurve>::BaseField,
) -> Result<GroupAffine<P>, HashToCurveError> {
element: <Affine<P> as AffineCurve>::BaseField,
) -> Result<Affine<P>, HashToCurveError> {
// first we need to map the field point to the isogenous curve
let point_on_isogenious_curve = self.swu_field_curve_hasher.map_to_curve(element).unwrap();
P::isogeny_map(point_on_isogenious_curve)
Expand Down
32 changes: 16 additions & 16 deletions ec/src/hashing/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use crate::{
},
map_to_curve_hasher::{MapToCurve, MapToCurveBasedHasher},
},
models::SWModelParameters,
short_weierstrass_jacobian::GroupAffine,
ModelParameters,
models::short_weierstrass::SWCurveConfig,
short_weierstrass::Affine,
CurveConfig,
};
use ark_ff::field_hashers::DefaultFieldHasher;
use ark_ff::{biginteger::BigInteger64, fields::Fp64, BigInt, MontBackend, MontFp};
Expand Down Expand Up @@ -53,7 +53,7 @@ const F127_ONE: F127 = MontFp!(F127, "1");

struct TestSWUMapToCurveParams;

impl ModelParameters for TestSWUMapToCurveParams {
impl CurveConfig for TestSWUMapToCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
Expand All @@ -76,7 +76,7 @@ impl ModelParameters for TestSWUMapToCurveParams {
/// pass
///
/// y^2 = x^3 + x + 63
impl SWModelParameters for TestSWUMapToCurveParams {
impl SWCurveConfig for TestSWUMapToCurveParams {
/// COEFF_A = 1
const COEFF_A: F127 = F127_ONE;

Expand Down Expand Up @@ -126,7 +126,7 @@ fn checking_the_hashing_parameters() {
#[test]
fn hash_arbitary_string_to_curve_swu() {
let test_swu_to_curve_hasher = MapToCurveBasedHasher::<
GroupAffine<TestSWUMapToCurveParams>,
Affine<TestSWUMapToCurveParams>,
DefaultFieldHasher<sha2::Sha256, 128>,
SWUMap<TestSWUMapToCurveParams>,
>::new(&[1])
Expand All @@ -147,7 +147,7 @@ fn hash_arbitary_string_to_curve_swu() {
fn map_field_to_curve_swu() {
let test_map_to_curve = SWUMap::<TestSWUMapToCurveParams>::new().unwrap();

let mut map_range: Vec<GroupAffine<TestSWUMapToCurveParams>> = vec![];
let mut map_range: Vec<Affine<TestSWUMapToCurveParams>> = vec![];
for current_field_element in 0..127 {
map_range.push(
test_map_to_curve
Expand Down Expand Up @@ -183,7 +183,7 @@ struct TestSWU127MapToIsogenousCurveParams;
/// First we define the isogenous curve
/// sage: E_isogenous.order()
/// 127
impl ModelParameters for TestSWU127MapToIsogenousCurveParams {
impl CurveConfig for TestSWU127MapToIsogenousCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
Expand All @@ -195,7 +195,7 @@ impl ModelParameters for TestSWU127MapToIsogenousCurveParams {

/// E_isogenous : Elliptic Curve defined by y^2 = x^3 + 109*x + 124 over Finite
/// Field of size 127
impl SWModelParameters for TestSWU127MapToIsogenousCurveParams {
impl SWCurveConfig for TestSWU127MapToIsogenousCurveParams {
/// COEFF_A = 109
const COEFF_A: F127 = MontFp!(F127, "109");

Expand All @@ -221,7 +221,7 @@ impl SWUParams for TestSWU127MapToIsogenousCurveParams {
/// The struct defining our parameters for the target curve of hashing
struct TestWBF127MapToCurveParams;

impl ModelParameters for TestWBF127MapToCurveParams {
impl CurveConfig for TestWBF127MapToCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
Expand All @@ -233,7 +233,7 @@ impl ModelParameters for TestWBF127MapToCurveParams {

/// E: Elliptic Curve defined by y^2 = x^3 + 3 over Finite
/// Field of size 127
impl SWModelParameters for TestWBF127MapToCurveParams {
impl SWCurveConfig for TestWBF127MapToCurveParams {
/// COEFF_A = 0
const COEFF_A: F127 = F127_ZERO;

Expand Down Expand Up @@ -264,7 +264,7 @@ impl SWModelParameters for TestWBF127MapToCurveParams {
impl WBParams for TestWBF127MapToCurveParams {
type IsogenousCurve = TestSWU127MapToIsogenousCurveParams;

const PHI_X_NOM: &'static [<Self::IsogenousCurve as ModelParameters>::BaseField] = &[
const PHI_X_NOM: &'static [<Self::IsogenousCurve as CurveConfig>::BaseField] = &[
MontFp!(F127, "4"),
MontFp!(F127, "63"),
MontFp!(F127, "23"),
Expand All @@ -281,7 +281,7 @@ impl WBParams for TestWBF127MapToCurveParams {
MontFp!(F127, "-57"),
];

const PHI_X_DEN: &'static [<Self::IsogenousCurve as ModelParameters>::BaseField] = &[
const PHI_X_DEN: &'static [<Self::IsogenousCurve as CurveConfig>::BaseField] = &[
MontFp!(F127, "2"),
MontFp!(F127, "31"),
MontFp!(F127, "-10"),
Expand All @@ -297,7 +297,7 @@ impl WBParams for TestWBF127MapToCurveParams {
MontFp!(F127, "1"),
];

const PHI_Y_NOM: &'static [<Self::IsogenousCurve as ModelParameters>::BaseField] = &[
const PHI_Y_NOM: &'static [<Self::IsogenousCurve as CurveConfig>::BaseField] = &[
MontFp!(F127, "-34"),
MontFp!(F127, "-57"),
MontFp!(F127, "30"),
Expand All @@ -319,7 +319,7 @@ impl WBParams for TestWBF127MapToCurveParams {
MontFp!(F127, "10"),
];

const PHI_Y_DEN: &'static [<Self::IsogenousCurve as ModelParameters>::BaseField] = &[
const PHI_Y_DEN: &'static [<Self::IsogenousCurve as CurveConfig>::BaseField] = &[
MontFp!(F127, "32"),
MontFp!(F127, "-18"),
MontFp!(F127, "-24"),
Expand Down Expand Up @@ -347,7 +347,7 @@ impl WBParams for TestWBF127MapToCurveParams {
#[test]
fn hash_arbitary_string_to_curve_wb() {
let test_wb_to_curve_hasher = MapToCurveBasedHasher::<
GroupAffine<TestWBF127MapToCurveParams>,
Affine<TestWBF127MapToCurveParams>,
DefaultFieldHasher<sha2::Sha256, 128>,
WBMap<TestWBF127MapToCurveParams>,
>::new(&[1])
Expand Down
10 changes: 5 additions & 5 deletions ec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ pub trait ProjectiveCurve:
+ for<'a> core::iter::Sum<&'a Self>
+ From<<Self as ProjectiveCurve>::Affine>
{
type Parameters: ModelParameters<ScalarField = Self::ScalarField, BaseField = Self::BaseField>;
type Config: CurveConfig<ScalarField = Self::ScalarField, BaseField = Self::BaseField>;
type ScalarField: PrimeField + SquareRootField;
type BaseField: Field;
type Affine: AffineCurve<
Parameters = Self::Parameters,
Config = Self::Config,
Projective = Self,
ScalarField = Self::ScalarField,
BaseField = Self::BaseField,
Expand Down Expand Up @@ -249,7 +249,7 @@ pub trait AffineCurve:
+ for<'a> core::iter::Sum<&'a Self>
+ From<<Self as AffineCurve>::Projective>
{
type Parameters: ModelParameters<ScalarField = Self::ScalarField, BaseField = Self::BaseField>;
type Config: CurveConfig<ScalarField = Self::ScalarField, BaseField = Self::BaseField>;

/// The group defined by this curve has order `h * r` where `r` is a large
/// prime. `Self::ScalarField` is the prime field defined by `r`
Expand All @@ -260,7 +260,7 @@ pub trait AffineCurve:

/// The projective representation of points on this curve.
type Projective: ProjectiveCurve<
Parameters = Self::Parameters,
Config = Self::Config,
Affine = Self,
ScalarField = Self::ScalarField,
BaseField = Self::BaseField,
Expand Down Expand Up @@ -310,7 +310,7 @@ pub trait AffineCurve:
/// `Self::ScalarField`.
#[must_use]
fn mul_by_cofactor_inv(&self) -> Self {
self.mul(Self::Parameters::COFACTOR_INV).into()
self.mul(Self::Config::COFACTOR_INV).into()
}
}

Expand Down
6 changes: 3 additions & 3 deletions ec/src/models/bls12/g1.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::{
bls12::Bls12Parameters,
short_weierstrass_jacobian::{GroupAffine, GroupProjective},
short_weierstrass::{Affine, Projective},
AffineCurve,
};
use num_traits::Zero;

pub type G1Affine<P> = GroupAffine<<P as Bls12Parameters>::G1Parameters>;
pub type G1Projective<P> = GroupProjective<<P as Bls12Parameters>::G1Parameters>;
pub type G1Affine<P> = Affine<<P as Bls12Parameters>::G1Parameters>;
pub type G1Projective<P> = Projective<<P as Bls12Parameters>::G1Parameters>;

#[derive(Derivative)]
#[derivative(
Expand Down
8 changes: 4 additions & 4 deletions ec/src/models/bls12/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use num_traits::{One, Zero};

use crate::{
bls12::{Bls12Parameters, TwistType},
models::SWModelParameters,
short_weierstrass_jacobian::{GroupAffine, GroupProjective},
models::short_weierstrass::SWCurveConfig,
short_weierstrass::{Affine, Projective},
AffineCurve,
};

pub type G2Affine<P> = GroupAffine<<P as Bls12Parameters>::G2Parameters>;
pub type G2Projective<P> = GroupProjective<<P as Bls12Parameters>::G2Parameters>;
pub type G2Affine<P> = Affine<<P as Bls12Parameters>::G2Parameters>;
pub type G2Projective<P> = Projective<<P as Bls12Parameters>::G2Parameters>;

#[derive(Derivative)]
#[derivative(
Expand Down
Loading