Page MenuHomePhabricator

[electrum] use libsecp256k1 for signature conversions
ClosedPublic

Authored by PiRK on Aug 28 2024, 14:36.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC6e34ee149f1c: [electrum] use libsecp256k1 for signature conversions
Summary
Test Plan

python test_runner.py

Diff Detail

Event Timeline

PiRK requested review of this revision.Aug 28 2024, 14:36

Tail of the build log:

    from . import ecc, networks
  File "/work/electrum/electrumabc/ecc.py", line 42, in <module>
    from .secp256k1 import SECP256K1_EC_UNCOMPRESSED, secp256k1
  File "/work/electrum/electrumabc/secp256k1.py", line 197, in <module>
    raise ImportError("Failed to load required library libsecp256k1")
ImportError: Failed to load required library libsecp256k1


======================================================================
ERROR: electrumabc_plugins.keepkey.tests.test_keepkey (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: electrumabc_plugins.keepkey.tests.test_keepkey
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/work/electrum/electrumabc_plugins/keepkey/tests/test_keepkey.py", line 5, in <module>
    from electrumabc.plugins import Plugins
  File "/work/electrum/electrumabc/plugins.py", line 56, in <module>
    from .bip32 import xpub_type
  File "/work/electrum/electrumabc/bip32.py", line 32, in <module>
    from . import ecc, networks
  File "/work/electrum/electrumabc/ecc.py", line 42, in <module>
    from .secp256k1 import SECP256K1_EC_UNCOMPRESSED, secp256k1
  File "/work/electrum/electrumabc/secp256k1.py", line 197, in <module>
    raise ImportError("Failed to load required library libsecp256k1")
ImportError: Failed to load required library libsecp256k1


======================================================================
ERROR: electrumabc_plugins.trezor.tests.test_trezor (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: electrumabc_plugins.trezor.tests.test_trezor
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/work/electrum/electrumabc_plugins/trezor/tests/test_trezor.py", line 5, in <module>
    from electrumabc.plugins import Plugins
  File "/work/electrum/electrumabc/plugins.py", line 56, in <module>
    from .bip32 import xpub_type
  File "/work/electrum/electrumabc/bip32.py", line 32, in <module>
    from . import ecc, networks
  File "/work/electrum/electrumabc/ecc.py", line 42, in <module>
    from .secp256k1 import SECP256K1_EC_UNCOMPRESSED, secp256k1
  File "/work/electrum/electrumabc/secp256k1.py", line 197, in <module>
    raise ImportError("Failed to load required library libsecp256k1")
ImportError: Failed to load required library libsecp256k1


----------------------------------------------------------------------
Ran 102 tests in 0.043s

FAILED (errors=30, skipped=4)
Testing `setup.py --version`: OK

ninja: build stopped: cannot make progress due to previous errors.
Build electrum-tests failed with exit code 1
PiRK planned changes to this revision.Aug 28 2024, 14:39

I forgot that this needs D16687 to be sorted out first

Fabien requested changes to this revision.Sep 4 2024, 08:15
Fabien added a subscriber: Fabien.
Fabien added inline comments.
electrum/electrumabc/ecc.py
163

Extract this part and and below to avoid duplication with get_r_and_s_from_der_sig (e.g. get_r_and_s_from_raw_sig)

This revision now requires changes to proceed.Sep 4 2024, 08:15
This revision is now accepted and ready to land.Sep 4 2024, 12:12