From aa50cc6ceda09a9f828df39de3f45494e69cf5af Mon Sep 17 00:00:00 2001 From: sanket1729 Date: Mon, 21 Mar 2022 16:32:19 -0700 Subject: [PATCH 1/2] Remove Schnorr word from keypairs Keypairs are pair of EC points that don't have anything to do with the signature algorithm --- src/key.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/key.rs b/src/key.rs index 82ffef9..5053c02 100644 --- a/src/key.rs +++ b/src/key.rs @@ -718,7 +718,7 @@ impl KeyPair { } } - /// Creates a Schnorr [`KeyPair`] directly from a secret key slice. + /// Creates a [`KeyPair`] directly from a secret key slice. /// /// # Errors /// @@ -743,7 +743,7 @@ impl KeyPair { } } - /// Creates a Schnorr [`KeyPair`] directly from a secret key string. + /// Creates a [`KeyPair`] directly from a secret key string. /// /// # Errors /// @@ -759,7 +759,7 @@ impl KeyPair { } } - /// Creates a Schnorr [`KeyPair`] directly from a secret key string and the global [`SECP256K1`] context. + /// Creates a [`KeyPair`] directly from a secret key string and the global [`SECP256K1`] context. /// /// # Errors /// From 676a9800df0e6e69df09bae1a6b6732777f1fd65 Mon Sep 17 00:00:00 2001 From: sanket1729 Date: Mon, 21 Mar 2022 16:29:30 -0700 Subject: [PATCH 2/2] Remove unnecessary panic message 1) All types in rust should have the guarantee that well-formed data is stored in SecretKey type. Therefore, IMO the panic message is unnecessary. --- src/key.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/key.rs b/src/key.rs index 5053c02..038723e 100644 --- a/src/key.rs +++ b/src/key.rs @@ -696,13 +696,7 @@ impl KeyPair { &mut self.0 } - /// Creates a Schnorr [`KeyPair`] directly from generic Secp256k1 secret key. - /// - /// # Panics - /// - /// Panics if internal representation of the provided [`SecretKey`] does not hold correct secret - /// key value obtained from Secp256k1 library previously, specifically when secret key value is - /// out-of-range (0 or in excess of the group order). + /// Creates a [`KeyPair`] directly from a Secp256k1 secret key. #[inline] pub fn from_secret_key( secp: &Secp256k1,