Skip to content

Commit

Permalink
Impl Debug for AnyEncryptionKey
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Sep 21, 2023
1 parent 7f2ee8c commit 72b2fc6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub mod utils;
#[cfg(feature = "serde")]
mod serde;

use std::fmt;

use rand_core::{CryptoRng, RngCore};
use rug::Integer;

Expand Down Expand Up @@ -217,3 +219,11 @@ impl AnyEncryptionKey for DecryptionKey {
self.encryption_key().in_signed_group(x)
}
}

impl<'a> fmt::Debug for dyn AnyEncryptionKey + 'a {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("PaillierEncKey")
.field("N", self.n())
.finish_non_exhaustive()
}
}

0 comments on commit 72b2fc6

Please sign in to comment.