From 56b73e32ce81acc50d0eca79f0c43825e48862c3 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 24 Nov 2022 20:20:27 +0000 Subject: [PATCH] Move `Ord` bound from `FieldExt` to `CurveAffine::{Base, Scalar}` This helps with the `FieldExt` removal while deferring the decision on whether to add an `Ord` bound to `ff::PrimeField`. --- src/arithmetic/curves.rs | 4 ++-- src/arithmetic/fields.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arithmetic/curves.rs b/src/arithmetic/curves.rs index f9b2ef4..ade9dbf 100644 --- a/src/arithmetic/curves.rs +++ b/src/arithmetic/curves.rs @@ -102,9 +102,9 @@ pub trait CurveAffine: + From<::Curve> { /// The scalar field of this elliptic curve. - type ScalarExt: FieldExt; + type ScalarExt: FieldExt + Ord; /// The base field over which this elliptic curve is constructed. - type Base: FieldExt; + type Base: FieldExt + Ord; /// The projective form of the curve type CurveExt: CurveExt::ScalarExt>; diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index ef45018..d42419d 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -30,7 +30,7 @@ pub(crate) trait SqrtTableHelpers: ff::PrimeField { /// This trait is a common interface for dealing with elements of a finite /// field. -pub trait FieldExt: ff::WithSmallOrderMulGroup<3> + Ord {} +pub trait FieldExt: ff::WithSmallOrderMulGroup<3> {} /// Parameters for a perfect hash function used in square root computation. #[cfg(feature = "sqrt-table")]