diff --git a/bellman/src/domain.rs b/bellman/src/domain.rs index 47f8ff083..e1dc22970 100644 --- a/bellman/src/domain.rs +++ b/bellman/src/domain.rs @@ -12,7 +12,7 @@ //! [Groth16]: https://eprint.iacr.org/2016/260 use ff::PrimeField; -use group::CurveProjective; +use group::CofactorCurve; use super::SynthesisError; @@ -196,23 +196,23 @@ pub trait Group: Sized + Copy + Clone + Send + Sync { fn group_sub_assign(&mut self, other: &Self); } -pub struct Point(pub G); +pub struct Point(pub G); -impl PartialEq for Point { +impl PartialEq for Point { fn eq(&self, other: &Point) -> bool { self.0 == other.0 } } -impl Copy for Point {} +impl Copy for Point {} -impl Clone for Point { +impl Clone for Point { fn clone(&self) -> Point { *self } } -impl Group for Point { +impl Group for Point { fn group_zero() -> Self { Point(G::identity()) } diff --git a/bellman/src/groth16/generator.rs b/bellman/src/groth16/generator.rs index 060ff1bec..e84fc12a9 100644 --- a/bellman/src/groth16/generator.rs +++ b/bellman/src/groth16/generator.rs @@ -3,7 +3,7 @@ use std::ops::{AddAssign, MulAssign}; use std::sync::Arc; use ff::{Field, PrimeField}; -use group::{CurveAffine, CurveProjective, Group, Wnaf}; +use group::{CurveAffine, CofactorCurve, Group, Wnaf}; use pairing::Engine; use super::{Parameters, VerifyingKey}; diff --git a/bellman/src/groth16/prover.rs b/bellman/src/groth16/prover.rs index ff91c2675..293cad2b7 100644 --- a/bellman/src/groth16/prover.rs +++ b/bellman/src/groth16/prover.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use futures::Future; use ff::{Field, PrimeField}; -use group::{CurveAffine, CurveProjective}; +use group::{CurveAffine, CofactorCurve}; use pairing::Engine; use super::{ParameterSource, Proof}; diff --git a/bellman/src/groth16/tests/dummy_engine.rs b/bellman/src/groth16/tests/dummy_engine.rs index 3ddb98c90..01e8b82d1 100644 --- a/bellman/src/groth16/tests/dummy_engine.rs +++ b/bellman/src/groth16/tests/dummy_engine.rs @@ -1,5 +1,5 @@ use ff::{Field, PrimeField}; -use group::{CurveAffine, CurveProjective, Group, GroupEncoding, PrimeGroup, UncompressedEncoding}; +use group::{CurveAffine, CofactorCurve, Group, GroupEncoding, PrimeGroup, UncompressedEncoding}; use pairing::{Engine, MillerLoopResult, MultiMillerLoop, PairingCurveAffine}; use rand_core::RngCore; @@ -393,7 +393,7 @@ impl Group for Fr { impl PrimeGroup for Fr {} -impl CurveProjective for Fr { +impl CofactorCurve for Fr { type Affine = Fr; fn to_affine(&self) -> Fr { @@ -425,7 +425,7 @@ impl AsRef<[u8]> for FakePoint { } impl CurveAffine for Fr { - type Projective = Fr; + type Curve = Fr; type Scalar = Fr; fn identity() -> Self { @@ -440,7 +440,7 @@ impl CurveAffine for Fr { Choice::from(if ::is_zero(self) { 1 } else { 0 }) } - fn to_projective(&self) -> Self::Projective { + fn to_curve(&self) -> Self::Curve { *self } } diff --git a/bellman/src/groth16/verifier.rs b/bellman/src/groth16/verifier.rs index e86b15aa5..5758d5d83 100644 --- a/bellman/src/groth16/verifier.rs +++ b/bellman/src/groth16/verifier.rs @@ -1,4 +1,4 @@ -use group::{CurveAffine, CurveProjective}; +use group::{CurveAffine, CofactorCurve}; use pairing::{MillerLoopResult, MultiMillerLoop}; use std::ops::{AddAssign, Neg}; @@ -27,7 +27,7 @@ pub fn verify_proof<'a, E: MultiMillerLoop>( return Err(SynthesisError::MalformedVerifyingKey); } - let mut acc = pvk.ic[0].to_projective(); + let mut acc = pvk.ic[0].to_curve(); for (i, b) in public_inputs.iter().zip(pvk.ic.iter().skip(1)) { AddAssign::<&E::G1>::add_assign(&mut acc, &(*b * i)); diff --git a/bellman/src/multiexp.rs b/bellman/src/multiexp.rs index c9e00d6ba..fea10c667 100644 --- a/bellman/src/multiexp.rs +++ b/bellman/src/multiexp.rs @@ -2,7 +2,7 @@ use super::multicore::Worker; use bit_vec::{self, BitVec}; use ff::{Endianness, Field, PrimeField}; use futures::Future; -use group::{CurveAffine, CurveProjective}; +use group::{CofactorCurve, CurveAffine}; use std::io; use std::iter; use std::ops::AddAssign; @@ -25,17 +25,17 @@ pub trait Source { fn skip(&mut self, amt: usize) -> Result<(), SynthesisError>; } -pub trait AddAssignFromSource: CurveProjective { +pub trait AddAssignFromSource: CofactorCurve { /// Parses the element from the source. Fails if the point is at infinity. - fn add_assign_from_source::Affine>>( + fn add_assign_from_source::Affine>>( &mut self, source: &mut S, ) -> Result<(), SynthesisError> { - AddAssign::<&::Affine>::add_assign(self, source.next()?); + AddAssign::<&::Affine>::add_assign(self, source.next()?); Ok(()) } } -impl AddAssignFromSource for G where G: CurveProjective {} +impl AddAssignFromSource for G where G: CofactorCurve {} impl SourceBuilder for (Arc>, usize) { type Source = (Arc>, usize); @@ -162,8 +162,8 @@ fn multiexp_inner( where for<'a> &'a Q: QueryDensity, D: Send + Sync + 'static + Clone + AsRef, - G: CurveProjective, - S: SourceBuilder<::Affine>, + G: CofactorCurve, + S: SourceBuilder<::Affine>, { // Perform this region of the multiexp let this = { @@ -274,8 +274,8 @@ pub fn multiexp( where for<'a> &'a Q: QueryDensity, D: Send + Sync + 'static + Clone + AsRef, - G: CurveProjective, - S: SourceBuilder<::Affine>, + G: CofactorCurve, + S: SourceBuilder<::Affine>, { let c = if exponents.len() < 32 { 3u32 @@ -296,8 +296,8 @@ where #[cfg(feature = "pairing")] #[test] fn test_with_bls12() { - fn naive_multiexp( - bases: Arc::Affine>>, + fn naive_multiexp( + bases: Arc::Affine>>, exponents: Arc>, ) -> G { assert_eq!(bases.len(), exponents.len()); diff --git a/group/src/lib.rs b/group/src/lib.rs index 0b105c051..839e31a3b 100644 --- a/group/src/lib.rs +++ b/group/src/lib.rs @@ -88,12 +88,10 @@ pub trait PrimeGroup: Group {} /// Projective representation of an elliptic curve point guaranteed to be /// in the correct prime order subgroup. -pub trait CurveProjective: - Group - + GroupOps<::Affine> - + GroupOpsOwned<::Affine> +pub trait CofactorCurve: + Group + GroupOps<::Affine> + GroupOpsOwned<::Affine> { - type Affine: CurveAffine + type Affine: CurveAffine + Mul + for<'r> Mul; @@ -134,11 +132,11 @@ pub trait CurveAffine: + 'static + GroupEncoding + Neg - + Mul<::Scalar, Output = ::Projective> - + for<'r> Mul<::Scalar, Output = ::Projective> + + Mul<::Scalar, Output = ::Curve> + + for<'r> Mul<::Scalar, Output = ::Curve> { type Scalar: PrimeField; - type Projective: CurveProjective; + type Curve: CofactorCurve; /// Returns the additive identity. fn identity() -> Self; @@ -150,8 +148,8 @@ pub trait CurveAffine: /// additive identity. fn is_identity(&self) -> Choice; - /// Converts this element into its affine representation. - fn to_projective(&self) -> Self::Projective; + /// Converts this element into its efficient representation. + fn to_curve(&self) -> Self::Curve; } pub trait GroupEncoding: Sized { diff --git a/group/src/tests/mod.rs b/group/src/tests/mod.rs index 763cee28e..920b44c91 100644 --- a/group/src/tests/mod.rs +++ b/group/src/tests/mod.rs @@ -3,9 +3,9 @@ use rand::SeedableRng; use rand_xorshift::XorShiftRng; use std::ops::{Mul, Neg}; -use crate::{CurveAffine, CurveProjective, GroupEncoding, UncompressedEncoding}; +use crate::{CofactorCurve, CurveAffine, GroupEncoding, UncompressedEncoding}; -pub fn curve_tests() { +pub fn curve_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -50,8 +50,8 @@ pub fn curve_tests() { // Transformations { let a = G::random(&mut rng); - let b = a.to_affine().to_projective(); - let c = a.to_affine().to_projective().to_affine().to_projective(); + let b = a.to_affine().to_curve(); + let c = a.to_affine().to_curve().to_affine().to_curve(); assert_eq!(a, b); assert_eq!(b, c); } @@ -65,7 +65,7 @@ pub fn curve_tests() { random_compressed_encoding_tests::(); } -fn random_wnaf_tests() { +fn random_wnaf_tests() { use crate::wnaf::*; let mut rng = XorShiftRng::from_seed([ @@ -184,7 +184,7 @@ fn random_wnaf_tests() { } } -fn random_negation_tests() { +fn random_negation_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -214,7 +214,7 @@ fn random_negation_tests() { } } -fn random_doubling_tests() { +fn random_doubling_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -242,7 +242,7 @@ fn random_doubling_tests() { } } -fn random_multiplication_tests() { +fn random_multiplication_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -277,7 +277,7 @@ fn random_multiplication_tests() { } } -fn random_addition_tests() { +fn random_addition_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -325,17 +325,17 @@ fn random_addition_tests() { // Mixed addition // (a + b) + c - tmp[3] = a_affine.to_projective(); + tmp[3] = a_affine.to_curve(); tmp[3].add_assign(&b_affine); tmp[3].add_assign(&c_affine); // a + (b + c) - tmp[4] = b_affine.to_projective(); + tmp[4] = b_affine.to_curve(); tmp[4].add_assign(&c_affine); tmp[4].add_assign(&a_affine); // (a + c) + b - tmp[5] = a_affine.to_projective(); + tmp[5] = a_affine.to_curve(); tmp[5].add_assign(&c_affine); tmp[5].add_assign(&b_affine); @@ -357,7 +357,7 @@ fn random_addition_tests() { } } -fn random_transformation_tests() { +fn random_transformation_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -366,7 +366,7 @@ fn random_transformation_tests() { for _ in 0..1000 { let g = G::random(&mut rng); let g_affine = g.to_affine(); - let g_projective = g_affine.to_projective(); + let g_projective = g_affine.to_curve(); assert_eq!(g, g_projective); } @@ -382,7 +382,7 @@ fn random_transformation_tests() { } for _ in 0..5 { let s = between.sample(&mut rng); - v[s] = v[s].to_affine().to_projective(); + v[s] = v[s].to_affine().to_curve(); } let expected_v = v.iter().map(|v| v.to_affine()).collect::>(); @@ -394,7 +394,7 @@ fn random_transformation_tests() { } } -fn random_compressed_encoding_tests() { +fn random_compressed_encoding_tests() { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, @@ -420,9 +420,9 @@ fn random_compressed_encoding_tests() { } } -pub fn random_uncompressed_encoding_tests() +pub fn random_uncompressed_encoding_tests() where - G::Affine: UncompressedEncoding, + ::Affine: UncompressedEncoding, { let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, diff --git a/group/src/wnaf.rs b/group/src/wnaf.rs index 0ee46cafc..64a2de1b5 100644 --- a/group/src/wnaf.rs +++ b/group/src/wnaf.rs @@ -2,10 +2,10 @@ use byteorder::{ByteOrder, LittleEndian}; use ff::PrimeField; use std::iter; -use super::{CurveProjective, Group}; +use super::{CofactorCurve, Group}; /// Replaces the contents of `table` with a w-NAF window table for the given window size. -pub(crate) fn wnaf_table(table: &mut Vec, mut base: G, window: usize) { +pub(crate) fn wnaf_table(table: &mut Vec, mut base: G, window: usize) { table.truncate(0); table.reserve(1 << (window - 1)); @@ -78,7 +78,7 @@ pub(crate) fn wnaf_form>(wnaf: &mut Vec, c: S, window: usize /// /// This function must be provided a `table` and `wnaf` that were constructed with /// the same window size; otherwise, it may panic or produce invalid results. -pub(crate) fn wnaf_exp(table: &[G], wnaf: &[i64]) -> G { +pub(crate) fn wnaf_exp(table: &[G], wnaf: &[i64]) -> G { let mut result = G::identity(); let mut found_one = false; @@ -110,7 +110,7 @@ pub struct Wnaf { window_size: W, } -impl Wnaf<(), Vec, Vec> { +impl Wnaf<(), Vec, Vec> { /// Construct a new wNAF context without allocating. pub fn new() -> Self { Wnaf { @@ -157,7 +157,7 @@ impl Wnaf<(), Vec, Vec> { } } -impl<'a, G: CurveProjective> Wnaf> { +impl<'a, G: CofactorCurve> Wnaf> { /// Constructs new space for the scalar representation while borrowing /// the computed window table, for sending the window table across threads. pub fn shared(&self) -> Wnaf> { @@ -169,7 +169,7 @@ impl<'a, G: CurveProjective> Wnaf> { } } -impl<'a, G: CurveProjective> Wnaf, &'a [i64]> { +impl<'a, G: CofactorCurve> Wnaf, &'a [i64]> { /// Constructs new space for the window table while borrowing /// the computed scalar representation, for sending the scalar representation /// across threads. @@ -184,7 +184,7 @@ impl<'a, G: CurveProjective> Wnaf, &'a [i64]> { impl> Wnaf { /// Performs exponentiation given a base. - pub fn base(&mut self, base: G) -> G + pub fn base(&mut self, base: G) -> G where B: AsMut>, { @@ -195,7 +195,7 @@ impl> Wnaf { impl>> Wnaf { /// Performs exponentiation given a scalar. - pub fn scalar(&mut self, scalar: &::Scalar) -> G + pub fn scalar(&mut self, scalar: &::Scalar) -> G where B: AsRef<[G]>, { diff --git a/pairing/src/bls12_381/ec.rs b/pairing/src/bls12_381/ec.rs index 8d2a3f18c..e480700f8 100644 --- a/pairing/src/bls12_381/ec.rs +++ b/pairing/src/bls12_381/ec.rs @@ -199,7 +199,7 @@ macro_rules! curve_impl { impl CurveAffine for $affine { type Scalar = $scalarfield; - type Projective = $projective; + type Curve = $projective; fn identity() -> Self { $affine { @@ -217,7 +217,7 @@ macro_rules! curve_impl { Choice::from(if self.infinity { 1 } else { 0 }) } - fn to_projective(&self) -> $projective { + fn to_curve(&self) -> $projective { (*self).into() } } @@ -466,30 +466,28 @@ macro_rules! curve_impl { } } - impl<'r> ::std::ops::Add<&'r <$projective as CurveProjective>::Affine> for $projective { + impl<'r> ::std::ops::Add<&'r $affine> for $projective { type Output = Self; #[inline] - fn add(self, other: &<$projective as CurveProjective>::Affine) -> Self { + fn add(self, other: &$affine) -> Self { let mut ret = self; ret.add_assign(other); ret } } - impl ::std::ops::Add<<$projective as CurveProjective>::Affine> for $projective { + impl ::std::ops::Add<$affine> for $projective { type Output = Self; #[inline] - fn add(self, other: <$projective as CurveProjective>::Affine) -> Self { + fn add(self, other: $affine) -> Self { self + &other } } - impl<'r> ::std::ops::AddAssign<&'r <$projective as CurveProjective>::Affine> - for $projective - { - fn add_assign(&mut self, other: &<$projective as CurveProjective>::Affine) { + impl<'r> ::std::ops::AddAssign<&'r $affine> for $projective { + fn add_assign(&mut self, other: &$affine) { if other.is_identity().into() { return; } @@ -567,44 +565,42 @@ macro_rules! curve_impl { } } - impl ::std::ops::AddAssign<<$projective as CurveProjective>::Affine> for $projective { + impl ::std::ops::AddAssign<$affine> for $projective { #[inline] - fn add_assign(&mut self, other: <$projective as CurveProjective>::Affine) { + fn add_assign(&mut self, other: $affine) { self.add_assign(&other); } } - impl<'r> ::std::ops::Sub<&'r <$projective as CurveProjective>::Affine> for $projective { + impl<'r> ::std::ops::Sub<&'r $affine> for $projective { type Output = Self; #[inline] - fn sub(self, other: &<$projective as CurveProjective>::Affine) -> Self { + fn sub(self, other: &$affine) -> Self { let mut ret = self; ret.sub_assign(other); ret } } - impl ::std::ops::Sub<<$projective as CurveProjective>::Affine> for $projective { + impl ::std::ops::Sub<$affine> for $projective { type Output = Self; #[inline] - fn sub(self, other: <$projective as CurveProjective>::Affine) -> Self { + fn sub(self, other: $affine) -> Self { self - &other } } - impl<'r> ::std::ops::SubAssign<&'r <$projective as CurveProjective>::Affine> - for $projective - { - fn sub_assign(&mut self, other: &<$projective as CurveProjective>::Affine) { + impl<'r> ::std::ops::SubAssign<&'r $affine> for $projective { + fn sub_assign(&mut self, other: &$affine) { self.add_assign(&other.neg()); } } - impl ::std::ops::SubAssign<<$projective as CurveProjective>::Affine> for $projective { + impl ::std::ops::SubAssign<$affine> for $projective { #[inline] - fn sub_assign(&mut self, other: <$projective as CurveProjective>::Affine) { + fn sub_assign(&mut self, other: $affine) { self.sub_assign(&other); } } @@ -746,7 +742,7 @@ macro_rules! curve_impl { impl PrimeGroup for $projective {} - impl CurveProjective for $projective { + impl CofactorCurve for $projective { type Affine = $affine; fn batch_normalize(p: &[Self], q: &mut [$affine]) { @@ -908,7 +904,7 @@ pub mod g1 { use crate::{Engine, PairingCurveAffine}; use ff::{BitIterator, Field, PrimeField}; use group::{ - CurveAffine, CurveProjective, Group, GroupEncoding, PrimeGroup, UncompressedEncoding, + CofactorCurve, CurveAffine, Group, GroupEncoding, PrimeGroup, UncompressedEncoding, }; use rand_core::RngCore; use std::fmt; @@ -1462,15 +1458,15 @@ pub mod g1 { assert!(b.is_on_curve() && b.is_in_correct_subgroup_assuming_on_curve()); assert!(c.is_on_curve() && c.is_in_correct_subgroup_assuming_on_curve()); - let mut tmp1 = a.to_projective(); - tmp1.add_assign(&b.to_projective()); + let mut tmp1 = a.to_curve(); + tmp1.add_assign(&b.to_curve()); assert_eq!(tmp1.to_affine(), c); - assert_eq!(tmp1, c.to_projective()); + assert_eq!(tmp1, c.to_curve()); - let mut tmp2 = a.to_projective(); + let mut tmp2 = a.to_curve(); tmp2.add_assign(&b); assert_eq!(tmp2.to_affine(), c); - assert_eq!(tmp2, c.to_projective()); + assert_eq!(tmp2, c.to_curve()); } #[test] @@ -1487,7 +1483,7 @@ pub mod g2 { use crate::{Engine, PairingCurveAffine}; use ff::{BitIterator, Field, PrimeField}; use group::{ - CurveAffine, CurveProjective, Group, GroupEncoding, PrimeGroup, UncompressedEncoding, + CofactorCurve, CurveAffine, Group, GroupEncoding, PrimeGroup, UncompressedEncoding, }; use rand_core::RngCore; use std::fmt; diff --git a/pairing/src/bls12_381/tests/mod.rs b/pairing/src/bls12_381/tests/mod.rs index e905a486a..1d9f41fc9 100644 --- a/pairing/src/bls12_381/tests/mod.rs +++ b/pairing/src/bls12_381/tests/mod.rs @@ -1,5 +1,5 @@ use ff::PrimeField; -use group::{CurveAffine, CurveProjective, GroupEncoding, UncompressedEncoding}; +use group::{CofactorCurve, CurveAffine, GroupEncoding, UncompressedEncoding}; use super::*; use crate::*; @@ -55,7 +55,7 @@ fn test_pairing_result_against_relic() { }); } -fn uncompressed_test_vectors(expected: &[u8]) +fn uncompressed_test_vectors(expected: &[u8]) where G::Affine: UncompressedEncoding, { @@ -85,7 +85,7 @@ where assert_eq!(&v[..], expected); } -fn compressed_test_vectors(expected: &[u8]) { +fn compressed_test_vectors(expected: &[u8]) { let mut e = G::identity(); let encoded_len = ::Repr::default().as_ref().len(); diff --git a/pairing/src/lib.rs b/pairing/src/lib.rs index 6c3e2b47f..6898bd553 100644 --- a/pairing/src/lib.rs +++ b/pairing/src/lib.rs @@ -23,7 +23,7 @@ pub mod bls12_381; use core::ops::Mul; use ff::{Field, PrimeField}; use group::{ - CurveAffine, CurveProjective, GroupOps, GroupOpsOwned, ScalarMul, ScalarMulOwned, + CofactorCurve, CurveAffine, GroupOps, GroupOpsOwned, ScalarMul, ScalarMulOwned, UncompressedEncoding, }; @@ -35,7 +35,7 @@ pub trait Engine: Sized + 'static + Clone { type Fr: PrimeField; /// The projective representation of an element in G1. - type G1: CurveProjective + type G1: CofactorCurve + From + GroupOps + GroupOpsOwned @@ -45,7 +45,7 @@ pub trait Engine: Sized + 'static + Clone { /// The affine representation of an element in G1. type G1Affine: PairingCurveAffine< Scalar = Self::Fr, - Projective = Self::G1, + Curve = Self::G1, Pair = Self::G2Affine, PairingResult = Self::Gt, > + From @@ -53,7 +53,7 @@ pub trait Engine: Sized + 'static + Clone { + for<'a> Mul<&'a Self::Fr, Output = Self::G1>; /// The projective representation of an element in G2. - type G2: CurveProjective + type G2: CofactorCurve + From + GroupOps + GroupOpsOwned @@ -63,7 +63,7 @@ pub trait Engine: Sized + 'static + Clone { /// The affine representation of an element in G2. type G2Affine: PairingCurveAffine< Scalar = Self::Fr, - Projective = Self::G2, + Curve = Self::G2, Pair = Self::G1Affine, PairingResult = Self::Gt, > + From diff --git a/pairing/src/tests/engine.rs b/pairing/src/tests/engine.rs index bf0f8849d..2cfc473b2 100644 --- a/pairing/src/tests/engine.rs +++ b/pairing/src/tests/engine.rs @@ -1,5 +1,5 @@ use ff::{Endianness, Field, PrimeField}; -use group::{CurveAffine, CurveProjective, Group}; +use group::{CofactorCurve, CurveAffine, Group}; use rand_core::SeedableRng; use rand_xorshift::XorShiftRng; use std::ops::MulAssign;