use super::*;
impl<N: Network, Private: Visibility<Boolean = Boolean<N>>> Eq for Entry<N, Private> {}
impl<N: Network, Private: Visibility<Boolean = Boolean<N>>> PartialEq for Entry<N, Private> {
fn eq(&self, other: &Self) -> bool {
*self.is_equal(other)
}
}
impl<N: Network, Private: Visibility<Boolean = Boolean<N>>> Equal<Self> for Entry<N, Private> {
type Output = Boolean<N>;
fn is_equal(&self, other: &Self) -> Self::Output {
match (self, other) {
(Self::Constant(a), Self::Constant(b)) => a.is_equal(b),
(Self::Public(a), Self::Public(b)) => a.is_equal(b),
(Self::Private(a), Self::Private(b)) => a.is_equal(b),
(Self::Constant(_), _) | (Self::Public(_), _) | (Self::Private(_), _) => Boolean::new(false),
}
}
fn is_not_equal(&self, other: &Self) -> Self::Output {
match (self, other) {
(Self::Constant(a), Self::Constant(b)) => a.is_not_equal(b),
(Self::Public(a), Self::Public(b)) => a.is_not_equal(b),
(Self::Private(a), Self::Private(b)) => a.is_not_equal(b),
(Self::Constant(_), _) | (Self::Public(_), _) | (Self::Private(_), _) => Boolean::new(true),
}
}
}