Remove unused bounds and methods from `FieldExt`

This commit is contained in:
Jack Grigg 2022-11-24 09:15:48 +00:00
parent 1bd803d57b
commit 0559163953
3 changed files with 1 additions and 17 deletions

View File

@ -32,7 +32,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::PrimeField + From<bool> + Ord + Group<Scalar = Self> {
pub trait FieldExt: ff::PrimeField + Ord + Group<Scalar = Self> {
/// Modulus of the field written as a string for display purposes
const MODULUS: &'static str;
@ -54,10 +54,6 @@ pub trait FieldExt: ff::PrimeField + From<bool> + Ord + Group<Scalar = Self> {
/// Obtains a field element that is congruent to the provided little endian
/// byte representation of an integer.
fn from_bytes_wide(bytes: &[u8; 64]) -> Self;
/// Gets the lower 128 bits of this field element when expressed
/// canonically.
fn get_lower_128(&self) -> u128;
}
/// Parameters for a perfect hash function used in square root computation.

View File

@ -767,12 +767,6 @@ impl FieldExt for Fp {
u64::from_le_bytes(bytes[56..64].try_into().unwrap()),
])
}
fn get_lower_128(&self) -> u128 {
let tmp = Fp::montgomery_reduce(self.0[0], self.0[1], self.0[2], self.0[3], 0, 0, 0, 0);
u128::from(tmp.0[0]) | (u128::from(tmp.0[1]) << 64)
}
}
#[cfg(feature = "gpu")]

View File

@ -766,12 +766,6 @@ impl FieldExt for Fq {
u64::from_le_bytes(bytes[56..64].try_into().unwrap()),
])
}
fn get_lower_128(&self) -> u128 {
let tmp = Fq::montgomery_reduce(self.0[0], self.0[1], self.0[2], self.0[3], 0, 0, 0, 0);
u128::from(tmp.0[0]) | (u128::from(tmp.0[1]) << 64)
}
}
#[cfg(feature = "gpu")]