use super::*;
impl<N: Network> Eq for Ciphertext<N> {}
impl<N: Network> PartialEq for Ciphertext<N> {
fn eq(&self, other: &Self) -> bool {
*self.is_equal(other)
}
}
impl<N: Network> Equal<Self> for Ciphertext<N> {
type Output = Boolean<N>;
fn is_equal(&self, other: &Self) -> Self::Output {
let mut equal = Boolean::new(true);
for (a, b) in self.0.iter().zip_eq(other.0.iter()) {
equal &= a.is_equal(b);
}
equal
}
fn is_not_equal(&self, other: &Self) -> Self::Output {
let mut not_equal = Boolean::new(false);
for (a, b) in self.0.iter().zip_eq(other.0.iter()) {
not_equal |= a.is_not_equal(b);
}
not_equal
}
}