diff --git a/ed448-goldilocks/src/curve/edwards/extended.rs b/ed448-goldilocks/src/curve/edwards/extended.rs index dd9c7dc9..a6887d7f 100644 --- a/ed448-goldilocks/src/curve/edwards/extended.rs +++ b/ed448-goldilocks/src/curve/edwards/extended.rs @@ -11,10 +11,10 @@ use crate::curve::twedwards::extended::ExtendedPoint as TwistedExtendedPoint; use crate::field::{FieldElement, Scalar}; use crate::*; use elliptic_curve::{ - Error, + CurveGroup, Error, array::{Array, typenum::Unsigned}, consts::{U28, U84}, - group::{Curve, Group, GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup}, + group::{Group, GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup}, hash2curve::{ExpandMsg, ExpandMsgXof, Expander, FromOkm}, ops::LinearCombination, point::NonIdentity, @@ -512,7 +512,7 @@ impl LinearCombination<[(EdwardsPoint, Scalar); N]> for EdwardsP impl LinearCombination<[(EdwardsPoint, Scalar)]> for EdwardsPoint {} -impl Curve for EdwardsPoint { +impl CurveGroup for EdwardsPoint { type AffineRepr = AffinePoint; fn to_affine(&self) -> AffinePoint { diff --git a/ed448-goldilocks/src/decaf/ops.rs b/ed448-goldilocks/src/decaf/ops.rs index 7b68d28a..832e2a04 100644 --- a/ed448-goldilocks/src/decaf/ops.rs +++ b/ed448-goldilocks/src/decaf/ops.rs @@ -4,7 +4,7 @@ use core::{ iter::Sum, ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -use elliptic_curve::group::Curve; +use elliptic_curve::CurveGroup; use super::DecafPoint; diff --git a/ed448-goldilocks/src/decaf/points.rs b/ed448-goldilocks/src/decaf/points.rs index e7be4e03..45b976c7 100644 --- a/ed448-goldilocks/src/decaf/points.rs +++ b/ed448-goldilocks/src/decaf/points.rs @@ -4,10 +4,10 @@ use crate::field::FieldElement; use crate::*; use elliptic_curve::{ - Error, Group, + CurveGroup, Error, Group, array::{Array, typenum::Unsigned}, consts::{U32, U56, U84}, - group::{Curve, GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup}, + group::{GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup}, hash2curve::{ExpandMsg, Expander, FromOkm}, ops::LinearCombination, point::NonIdentity, @@ -237,7 +237,7 @@ impl LinearCombination<[(DecafPoint, Scalar); N]> for DecafPoint impl LinearCombination<[(DecafPoint, Scalar)]> for DecafPoint {} -impl Curve for DecafPoint { +impl CurveGroup for DecafPoint { type AffineRepr = DecafAffinePoint; fn to_affine(&self) -> Self::AffineRepr { diff --git a/k256/src/arithmetic/projective.rs b/k256/src/arithmetic/projective.rs index 04d8b059..b7cf9ffe 100644 --- a/k256/src/arithmetic/projective.rs +++ b/k256/src/arithmetic/projective.rs @@ -9,9 +9,9 @@ use core::{ ops::{Add, AddAssign, Neg, Sub, SubAssign}, }; use elliptic_curve::{ - BatchNormalize, Error, Result, + BatchNormalize, CurveGroup, Error, Result, group::{ - Curve, Group, GroupEncoding, + Group, GroupEncoding, ff::Field, prime::{PrimeCurve, PrimeCurveAffine, PrimeGroup}, }, @@ -257,10 +257,10 @@ impl From for ProjectivePoint { } impl BatchNormalize<[ProjectivePoint; N]> for ProjectivePoint { - type Output = [::AffineRepr; N]; + type Output = [::AffineRepr; N]; #[inline] - fn batch_normalize(points: &[Self; N]) -> [::AffineRepr; N] { + fn batch_normalize(points: &[Self; N]) -> [::AffineRepr; N] { let zs = [FieldElement::ONE; N]; let mut affine_points = [AffinePoint::IDENTITY; N]; batch_normalize_generic(points, zs, &mut affine_points); @@ -270,10 +270,10 @@ impl BatchNormalize<[ProjectivePoint; N]> for ProjectivePoint { #[cfg(feature = "alloc")] impl BatchNormalize<[ProjectivePoint]> for ProjectivePoint { - type Output = Vec<::AffineRepr>; + type Output = Vec<::AffineRepr>; #[inline] - fn batch_normalize(points: &[Self]) -> Vec<::AffineRepr> { + fn batch_normalize(points: &[Self]) -> Vec<::AffineRepr> { let zs = vec![FieldElement::ONE; points.len()]; let mut affine_points = vec![AffinePoint::IDENTITY; points.len()]; batch_normalize_generic(points, zs, &mut affine_points); @@ -454,7 +454,7 @@ impl GroupEncoding for ProjectivePoint { impl PrimeGroup for ProjectivePoint {} -impl Curve for ProjectivePoint { +impl CurveGroup for ProjectivePoint { type AffineRepr = AffinePoint; fn to_affine(&self) -> AffinePoint { @@ -698,9 +698,9 @@ mod tests { Scalar, test_vectors::group::{ADD_TEST_VECTORS, MUL_TEST_VECTORS}, }; - use elliptic_curve::Field; + use elliptic_curve::BatchNormalize; use elliptic_curve::group::{ff::PrimeField, prime::PrimeCurveAffine}; - use elliptic_curve::{BatchNormalize, group}; + use elliptic_curve::{CurveGroup, Field}; use rand_core::{OsRng, TryRngCore}; #[cfg(feature = "alloc")] @@ -737,7 +737,7 @@ mod tests { expected ); - ::batch_normalize(&[g, h], &mut res); + ::batch_normalize(&[g, h], &mut res); assert_eq!(res, expected); let mut res = [AffinePoint::IDENTITY; 3]; @@ -753,7 +753,7 @@ mod tests { expected ); - ::batch_normalize( + ::batch_normalize( &[g, ProjectivePoint::IDENTITY, non_normalized_identity], &mut res, ); @@ -774,7 +774,7 @@ mod tests { >::batch_normalize(scalars.as_slice()); assert_eq!(res, expected); - ::batch_normalize(&[g, h], res.as_mut()); + ::batch_normalize(&[g, h], res.as_mut()); assert_eq!(res.to_vec(), expected); let expected = vec![g.to_affine(), AffinePoint::IDENTITY]; @@ -783,7 +783,7 @@ mod tests { assert_eq!(res, expected); - ::batch_normalize( + ::batch_normalize( &[g, ProjectivePoint::IDENTITY], res.as_mut(), ); diff --git a/primeorder/src/projective.rs b/primeorder/src/projective.rs index 46d17947..6389a6ae 100644 --- a/primeorder/src/projective.rs +++ b/primeorder/src/projective.rs @@ -9,11 +9,12 @@ use core::{ ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use elliptic_curve::{ - BatchNormalize, Error, FieldBytes, FieldBytesSize, PrimeField, PublicKey, Result, Scalar, + BatchNormalize, CurveGroup, Error, FieldBytes, FieldBytesSize, PrimeField, PublicKey, Result, + Scalar, array::ArraySize, bigint::ArrayEncoding, group::{ - Curve, Group, GroupEncoding, + Group, GroupEncoding, prime::{PrimeCurve, PrimeGroup}, }, ops::{BatchInvert, LinearCombination}, @@ -308,7 +309,7 @@ where } } -impl Curve for ProjectivePoint +impl CurveGroup for ProjectivePoint where Self: Double, C: PrimeCurveParams, @@ -333,10 +334,10 @@ where Self: Double, C: PrimeCurveParams, { - type Output = [::AffineRepr; N]; + type Output = [::AffineRepr; N]; #[inline] - fn batch_normalize(points: &[Self; N]) -> [::AffineRepr; N] { + fn batch_normalize(points: &[Self; N]) -> [::AffineRepr; N] { let zs = [C::FieldElement::ONE; N]; let mut affine_points = [C::AffinePoint::IDENTITY; N]; batch_normalize_generic(points, zs, &mut affine_points); @@ -350,10 +351,10 @@ where Self: Double, C: PrimeCurveParams, { - type Output = Vec<::AffineRepr>; + type Output = Vec<::AffineRepr>; #[inline] - fn batch_normalize(points: &[Self]) -> Vec<::AffineRepr> { + fn batch_normalize(points: &[Self]) -> Vec<::AffineRepr> { let mut zs = vec![C::FieldElement::ONE; points.len()]; let mut affine_points = vec![AffinePoint::IDENTITY; points.len()]; batch_normalize_generic(points, zs.as_mut_slice(), &mut affine_points);