Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pysha3 no longer works #70

Closed
pjkundert opened this issue Nov 8, 2022 · 3 comments
Closed

pysha3 no longer works #70

pjkundert opened this issue Nov 8, 2022 · 3 comments

Comments

@pjkundert
Copy link
Contributor

Attempting to use python-hdwallet in Python 3.11 fails, with:

× Running setup.py install for pysha3 did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running install
      /opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x[86](https://github.com/pjkundert/python-slip39/actions/runs/3411849600/jobs/5676582611#step:4:87)_64-cpython-311
      copying sha3.py -> build/lib.linux-x86_64-cpython-311
      running build_ext
      building '_pysha3' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/Modules
      creating build/temp.linux-x86_64-cpython-311/Modules/_sha3
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_WITH_KECCAK=1 -I/opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11 -c Modules/_sha3/sha3module.c -o build/temp.linux-x86_64-cpython-311/Modules/_sha3/sha3module.o
      In file included from Modules/_sha3/sha3module.c:20:
      Modules/_sha3/backport.inc:78:10: fatal error: pystrhex.h: No such file or directory
         78 | #include "pystrhex.h"
            |          ^~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

The pysha3 module is used only for Keccak hashing, so can be replaced by the pycrptodome modules's Crypto.Hash.keccak. I've added tests to ensure this transition results in the same hashes.

In the future, it might be possible to also eliminate the edcsa module and use pycryptodome for ECDSA as well.

Fixed in #69

@meherett
Copy link
Member

meherett commented Nov 8, 2022

Done #69

@meherett meherett closed this as completed Nov 8, 2022
@pjkundert
Copy link
Contributor Author

Thanks!! I updated the version from v2.1.1 to v2.1.2; any idea when you might push a new release to pypi.org/project/hdwallet, @meherett?

@meherett
Copy link
Member

meherett commented Nov 9, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants