diff --git a/ferveo-common/src/keypair.rs b/ferveo-common/src/keypair.rs index 485241b3..9b251125 100644 --- a/ferveo-common/src/keypair.rs +++ b/ferveo-common/src/keypair.rs @@ -61,15 +61,7 @@ impl PublicKey { impl PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { - if self.encryption_key.x() == other.encryption_key.x() { - return self - .encryption_key - .y() - .partial_cmp(&other.encryption_key.y()); - } - self.encryption_key - .x() - .partial_cmp(&other.encryption_key.x()) + Some(self.cmp(other)) } } @@ -102,7 +94,7 @@ pub struct Keypair { impl PartialOrd for Keypair { fn partial_cmp(&self, other: &Self) -> Option { - self.decryption_key.partial_cmp(&other.decryption_key) + Some(self.cmp(other)) } } diff --git a/ferveo/src/api.rs b/ferveo/src/api.rs index b2179ee6..3c354bcb 100644 --- a/ferveo/src/api.rs +++ b/ferveo/src/api.rs @@ -139,7 +139,7 @@ impl From for FerveoVariant { } #[serde_as] -#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DkgPublicKey( #[serde_as(as = "serialization::SerdeAs")] pub(crate) G1Affine, );