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.
This commit is contained in:
Andreas Fackler 2019-12-20 17:33:47 +01:00 committed by Andreas Fackler
parent 2d332a82bd
commit 16a3bb650c
1 changed files with 2 additions and 4 deletions

View File

@ -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)
}
}