Skip to content

Commit

Permalink
Merge #47: Replace pysha3 with pycryptodomex
Browse files Browse the repository at this point in the history
b133ae2 Replace pysha3 with pycryptodomex (Timothy Redaelli)

Pull request description:

  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

Top commit has no ACKs.

Tree-SHA512: aa582dcfcdfa112aabf2fa9d7f83258cc33a2ab0061d144c826d59641bbad720b2dfbe9ae827229dec1d70bf7bd28c1edd5240a45f8a060d37e8f462ae1d5a85
  • Loading branch information
petertodd committed Nov 20, 2022
2 parents eeafcd6 + b133ae2 commit 5cc1670
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 5cc1670

Please sign in to comment.