From 16edbd41963f79638325f1864f21e9d4520fe859 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 19 Apr 2023 15:11:34 -0700 Subject: [PATCH] Sign gossip messages without grinding low R signatures Gossip messages always use signatures in their compact form, so grinding for low R signatures is unnecessary. --- lightning/src/chain/keysinterface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index f291f4c81..b1290708b 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -928,7 +928,7 @@ impl EcdsaChannelSigner for InMemorySigner { &self, msg: &UnsignedChannelAnnouncement, secp_ctx: &Secp256k1 ) -> Result { let msghash = hash_to_message!(&Sha256dHash::hash(&msg.encode()[..])[..]); - Ok(sign(secp_ctx, &msghash, &self.funding_key)) + Ok(secp_ctx.sign_ecdsa(&msghash, &self.funding_key)) } } @@ -1335,7 +1335,7 @@ impl NodeSigner for KeysManager { fn sign_gossip_message(&self, msg: UnsignedGossipMessage) -> Result { let msg_hash = hash_to_message!(&Sha256dHash::hash(&msg.encode()[..])[..]); - Ok(sign(&self.secp_ctx, &msg_hash, &self.node_secret)) + Ok(self.secp_ctx.sign_ecdsa(&msg_hash, &self.node_secret)) } } -- 2.39.5