From 16a3bb650c78f8ebd570b457a26d92df79c6a16b Mon Sep 17 00:00:00 2001 From: Andreas Fackler Date: Fri, 20 Dec 2019 17:33:47 +0100 Subject: [PATCH] Make `reveal` print the secret key, not the public one. That's what the method documentation says. It explicitly warns that it reveals the secret key, unlike the Debug implementation. --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6612fa3..236baae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -402,8 +402,7 @@ impl SecretKey { /// the `Debug` implementation in that it *does* leak the secret prime /// field element. pub fn reveal(&self) -> String { - let uncomp = self.public_key().0.into_affine().into_uncompressed(); - format!("SecretKey({:0.10})", HexFmt(uncomp)) + format!("SecretKey({:?})", self.0) } } @@ -474,8 +473,7 @@ impl SecretKeyShare { /// the `Debug` implementation in that it *does* leak the secret prime /// field element. pub fn reveal(&self) -> String { - let uncomp = self.0.public_key().0.into_affine().into_uncompressed(); - format!("SecretKeyShare({:0.10})", HexFmt(uncomp)) + format!("SecretKeyShare({:?})", (self.0).0) } }