diff --git a/src/lib.rs b/src/lib.rs index 1f76d0b..0faf447 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,8 @@ pub mod utils; #[cfg(feature = "serde")] mod serde; +use std::fmt; + use rand_core::{CryptoRng, RngCore}; use rug::Integer; @@ -217,3 +219,11 @@ impl AnyEncryptionKey for DecryptionKey { self.encryption_key().in_signed_group(x) } } + +impl fmt::Debug for dyn AnyEncryptionKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("PaillierEncKey") + .field("N", self.n()) + .finish_non_exhaustive() + } +}