Skip to content

Commit

Permalink
Replace pysha3 with pycryptodomex
Browse files Browse the repository at this point in the history
pysha3 is not maintained anymore and it doesn't build correctly with
Python 3.11 so replace it with pycryptodomex that is still maintained and
working correctly with new python versions
  • Loading branch information
drizzt committed Oct 17, 2022
1 parent eeafcd6 commit b133ae2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions opentimestamps/core/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# in the LICENSE file.

import binascii
import Cryptodome.Hash.keccak
import hashlib
import sha3
import opentimestamps.core.serialize

class MsgValueError(ValueError):
Expand Down Expand Up @@ -344,6 +344,6 @@ class OpKECCAK256(UnaryOp):
DIGEST_LENGTH = 32

def _do_op_call(self, msg):
r = sha3.keccak_256(bytes(msg)).digest()
r = Cryptodome.Hash.keccak.new(digest_bits=256, data=bytes(msg)).digest()
assert len(r) == self.DIGEST_LENGTH
return r
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python-bitcoinlib>=0.9.0,<0.12.0
GitPython>=2.0.8
pysha3>=1.0.2
pycryptodomex>=3.3.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['python-bitcoinlib>=0.9.0,<0.12.0',
'pysha3>=1.0.2'],
'pycryptodomex>=3.3.1'],

# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
Expand Down

0 comments on commit b133ae2

Please sign in to comment.