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 {
if self.0.len() != other.0.len() {
return Boolean::new(false);
}
if self.0.iter().zip_eq(other.0.iter()).all(|(a, b)| *a.is_equal(b)) {
Boolean::new(true)
} else {
Boolean::new(false)
}
}
fn is_not_equal(&self, other: &Self) -> Self::Output {
!self.is_equal(other)
}
}