diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d64e4dd0..26a5e2bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The main features of this release are: - Small speedups to MSMs - Big speedups to radix-2 FFTs - Fix in the assembly arithmetic backend +- Adding new traits for basic curve cycles and pairing based curve cycles ### Breaking changes - #20 (ark-poly) Move univariate DensePolynomial and SparsePolynomial into a @@ -80,6 +81,7 @@ The main features of this release are: - #169 (ark-poly) Improve radix-2 FFTs by moving to a faster algorithm by Riad S. Wahby. - #171, #173, #176 (ark-poly) Apply significant further speedups to the new radix-2 FFT. - #188 (ark-ec) Make Short Weierstrass random sampling result in an element with unknown discrete log +- #190 (ark-ec) Add curve cycle trait and extended pairing cycle trait for all types of ec cycles. ### Bug fixes - #36 (ark-ec) In Short-Weierstrass curves, include an infinity bit in `ToConstraintField`. diff --git a/ec/src/lib.rs b/ec/src/lib.rs index 1fda197e5..756a961ac 100644 --- a/ec/src/lib.rs +++ b/ec/src/lib.rs @@ -313,6 +313,7 @@ pub fn prepare_g2(g: impl Into) -> E::G2Prepared } /// A cycle of pairing-friendly elliptic curves. +#[deprecated(note = "Please use `PairingFriendlyCycle` instead")] pub trait CycleEngine: Sized + 'static + Copy + Debug + Sync + Send where ::G1Projective: MulAssign<::Fq>, @@ -324,3 +325,31 @@ where Fq = ::Fr, >; } + +pub trait CurveCycle +where + ::Projective: MulAssign<::BaseField>, + ::Projective: MulAssign<::BaseField>, +{ + type E1: AffineCurve< + BaseField = ::ScalarField, + ScalarField = ::BaseField, + >; + type E2: AffineCurve; +} + +pub trait PairingFriendlyCycle: CurveCycle { + type Engine1: PairingEngine< + G1Affine = Self::E1, + G1Projective = ::Projective, + Fq = ::BaseField, + Fr = ::ScalarField, + >; + + type Engine2: PairingEngine< + G2Affine = Self::E2, + G2Projective = ::Projective, + Fq = ::BaseField, + Fr = ::ScalarField, + >; +}