From: Timothy Redaelli Date: Mon, 17 Oct 2022 14:59:47 +0200 Subject: Replace pysha3 with pycryptodomex 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 Origin: https://github.com/opentimestamps/python-opentimestamps/pull/47 --- opentimestamps/core/op.py | 4 ++-- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opentimestamps/core/op.py b/opentimestamps/core/op.py index b67a2b7..29f2e86 100644 --- a/opentimestamps/core/op.py +++ b/opentimestamps/core/op.py @@ -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): @@ -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 diff --git a/requirements.txt b/requirements.txt index 278ef7b..835eea6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ python-bitcoinlib>=0.9.0,<0.12.0 GitPython>=2.0.8 -pysha3>=1.0.2 +pycryptodomex>=3.3.1 diff --git a/setup.py b/setup.py index 1802f9e..cda6aa7 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ setup( # 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,