HomePhabricator

[electrum] use pycryptodomex everywhere, drop pycryptodome

Description

[electrum] use pycryptodomex everywhere, drop pycryptodome

Summary:
pycryptodome and pycryptodomex are the exact same library with a slightly different API. Settle on using pycryptodomex everywhere. This removes the double dependency, which currently installed two different versions when packaging the binaries.

See:

tl;dr;

The installation procedure depends on the package you want the library to be in. PyCryptodome can be used as:

  • an almost drop-in replacement for the old PyCrypto library. You install it with:

    pip install pycryptodome

    In this case, all modules are installed under the Crypto package. One must avoid having both PyCrypto and PyCryptodome installed at the same time, as they will interfere with each other.

    This option is therefore recommended only when you are sure that the whole application is deployed in a virtualenv.
  • a library independent of the old PyCrypto. You install it with:

    pip install pycryptodomex

    In this case, all modules are installed under the Cryptodome package. PyCrypto and PyCryptodome can coexist.

As this is already a de-facto requirement (a wallet with many addresses will be significantly slowed down when it is not available), add it to the main requirements.txt rather than requirements-binaries.txt

Depends on D14131

Test Plan:
This shows that the only remaining reference to pycryptodome is in an old release note.

grep -r pycryptodome | wc -l
grep -r pycryptodomex | wc -l
grep -r pycryptodome[^x]

grep -r Crypto to check that Crypto is no longer imported anywhere.

Run unit tests, run the application.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Jun 27 2023, 12:03
PiRKPushed on Jun 27 2023, 13:41
Reviewer
Restricted Project
Differential Revision
D14132: [electrum] use pycryptodomex everywhere, drop pycryptodome
Parents
rABCb62bbb97ea11: [electrum] remove winconsole
Branches
Unknown
Tags
Unknown