diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index 6d638c9..46b9a85 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -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 + Ord + Group { +pub trait FieldExt: ff::PrimeField + Ord + Group { /// 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 + Ord + Group { /// 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. diff --git a/src/fields/fp.rs b/src/fields/fp.rs index f781cff..b505c99 100644 --- a/src/fields/fp.rs +++ b/src/fields/fp.rs @@ -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")] diff --git a/src/fields/fq.rs b/src/fields/fq.rs index 2046530..8f70cb5 100644 --- a/src/fields/fq.rs +++ b/src/fields/fq.rs @@ -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")]