diff --git a/sunscreen_tfhe/src/dst.rs b/sunscreen_tfhe/src/dst.rs index 5d101ab6f..d67d74164 100644 --- a/sunscreen_tfhe/src/dst.rs +++ b/sunscreen_tfhe/src/dst.rs @@ -24,13 +24,14 @@ macro_rules! dst { paste::paste! { $(#[$meta])* - #[derive($($derive,)*)] + #[derive($($derive,)* PartialEq)] pub struct $t where T: Clone $(+ $t_bounds)* { data: aligned_vec::AVec<$wrapper, aligned_vec::ConstAlign<{ crate::scratch::SIMD_ALIGN }>> } /// A reference to the data structure. #[repr(transparent)] + #[derive(PartialEq)] pub struct $ref_t where T: Clone $(+ $t_bounds)* { data: [$wrapper], } diff --git a/sunscreen_tfhe/src/entities/polynomial.rs b/sunscreen_tfhe/src/entities/polynomial.rs index 2c747fb50..93502286a 100644 --- a/sunscreen_tfhe/src/entities/polynomial.rs +++ b/sunscreen_tfhe/src/entities/polynomial.rs @@ -21,7 +21,7 @@ dst! { Polynomial, PolynomialRef, NoWrapper, - (Debug, Clone, PartialEq, Eq, Serialize, Deserialize), + (Debug, Clone, Serialize, Deserialize), () } dst_iter! { PolynomialIterator, PolynomialIteratorMut, ParallelPolynomialIterator, ParallelPolynomialIteratorMut, NoWrapper, PolynomialRef, () } @@ -375,12 +375,6 @@ where } } -impl PartialEq for PolynomialRef { - fn eq(&self, other: &Self) -> bool { - self.coeffs() == other.coeffs() - } -} - impl std::fmt::Debug for PolynomialRef { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("PolynomialRef") @@ -398,7 +392,6 @@ mod tests { #[test] fn can_add_polynomials() { let a = Polynomial::new(&[1, 2, 3]); - let b = Polynomial::new(&[4, 5, 6]); let expected = Polynomial::new(&[5, 7, 9]); diff --git a/sunscreen_tfhe/src/entities/polynomial_fft.rs b/sunscreen_tfhe/src/entities/polynomial_fft.rs index 0e5e81758..70544bc61 100644 --- a/sunscreen_tfhe/src/entities/polynomial_fft.rs +++ b/sunscreen_tfhe/src/entities/polynomial_fft.rs @@ -15,7 +15,7 @@ dst! { PolynomialFft, PolynomialFftRef, NoWrapper, - (Debug, Clone, PartialEq, Eq,), + (Debug, Clone), () } dst_iter!( diff --git a/sunscreen_tfhe/src/entities/polynomial_list.rs b/sunscreen_tfhe/src/entities/polynomial_list.rs index c2b615192..046bb2c42 100644 --- a/sunscreen_tfhe/src/entities/polynomial_list.rs +++ b/sunscreen_tfhe/src/entities/polynomial_list.rs @@ -12,7 +12,7 @@ dst! { PolynomialList, PolynomialListRef, NoWrapper, - (Debug, Clone, PartialEq, Eq,), + (Debug, Clone), () }