Skip to content

Commit

Permalink
Sign gossip messages without grinding low R signatures
Browse files Browse the repository at this point in the history
Gossip messages always use signatures in their compact form, so grinding
for low R signatures is unnecessary.
  • Loading branch information
wpaulino committed Apr 19, 2023
1 parent 31b79d6 commit 21be311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightning/src/chain/keysinterface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ impl EcdsaChannelSigner for InMemorySigner {
&self, msg: &UnsignedChannelAnnouncement, secp_ctx: &Secp256k1<secp256k1::All>
) -> Result<Signature, ()> {
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))
}
}

Expand Down Expand Up @@ -1335,7 +1335,7 @@ impl NodeSigner for KeysManager {

fn sign_gossip_message(&self, msg: UnsignedGossipMessage) -> Result<Signature, ()> {
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))
}
}

Expand Down

0 comments on commit 21be311

Please sign in to comment.