HomePhabricator

[electrum] deduplicate the ECPrivkey.sign code

Description

[electrum] deduplicate the ECPrivkey.sign code

Summary:
sign_transaction and sign_message use very similar code, with just the decoding and encoding functions changing. Wrap this code in a new sign method called by the other two methods. This will make it simpler to switch the signing code to not rely on the ecdsa library.

Partial backport of https://github.com/spesmilo/electrum/commit/ac94d6d055807ecb3b2ba044b0bcd9a12a9b3b7c

Depends on D16685

Test Plan: python test_runner.py

Reviewers: #bitcoin_abc, bytesofman

Reviewed By: #bitcoin_abc, bytesofman

Differential Revision: https://reviews.bitcoinabc.org/D16686

Details

Provenance
PiRKAuthored on Aug 27 2024, 14:08
PiRKPushed on Sep 3 2024, 06:19
Reviewer
Restricted Project
Differential Revision
D16686: [electrum] deduplicate the ECPrivkey.sign code
Parents
rABCb0d72c50a89b: [electrum] grind ecdsa low R signature when using libsecp256k1
Branches
Unknown
Tags
Unknown