Skip to content

Commit

Permalink
feat(ferveo): derive eq in DkgPublicKey
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Oct 31, 2023
1 parent 13d9d26 commit ccdd5e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions ferveo-common/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ impl<E: Pairing> PublicKey<E> {

impl<E: Pairing> PartialOrd for PublicKey<E> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
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))
}
}

Expand Down Expand Up @@ -102,7 +94,7 @@ pub struct Keypair<E: Pairing> {

impl<E: Pairing> PartialOrd for Keypair<E> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.decryption_key.partial_cmp(&other.decryption_key)
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion ferveo/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl From<bindings_wasm::FerveoVariant> 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,
);
Expand Down

0 comments on commit ccdd5e6

Please sign in to comment.