use super::*;
impl<A: Aleo> Equal<Self> for Ciphertext<A> {
type Output = Boolean<A>;
fn is_equal(&self, other: &Self) -> Self::Output {
if self.0.len() != other.0.len() {
return Boolean::constant(false);
}
let mut equal = Boolean::constant(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 {
if self.0.len() != other.0.len() {
return Boolean::constant(true);
}
let mut not_equal = Boolean::constant(false);
for (a, b) in self.0.iter().zip_eq(other.0.iter()) {
not_equal |= a.is_not_equal(b);
}
not_equal
}
}