From: Wilmer Paulino Date: Wed, 19 Apr 2023 22:11:34 +0000 (-0700) Subject: Sign gossip messages without grinding low R signatures X-Git-Tag: v0.0.115~10^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=16edbd41963f79638325f1864f21e9d4520fe859;p=rust-lightning 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. --- 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)) } }