Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions eth/precompiles/blake2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import blake2b
from eth_utils import (
ValidationError,
)
Expand All @@ -11,6 +10,11 @@
BaseComputation,
)

try:
from blake2b import compress as blake2b_compress
except ImportError:
from eth._utils.blake2.compression import blake2b_compress

GAS_COST_PER_ROUND = 1


Expand All @@ -25,5 +29,5 @@ def blake2b_fcompress(computation: BaseComputation) -> BaseComputation:

computation.consume_gas(gas_cost, reason=f"Blake2b Compress Precompile w/ {num_rounds} rounds")

computation.output = blake2b.compress(*parameters)
computation.output = blake2b_compress(*parameters)
return computation
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

deps = {
'eth': [
"blake2b-py>=0.1.4,<0.2",
"cached-property>=1.5.1,<2",
"eth-bloom>=1.0.3,<2.0.0",
"eth-keys>=0.2.1,<0.4.0",
Expand All @@ -23,6 +22,7 @@
# Installing these libraries may make the evm perform better than
# using the default fallbacks though.
'eth-extra': [
"blake2b-py>=0.1.4,<0.2",
"coincurve>=13.0.0,<14.0.0",
"eth-hash[pysha3];implementation_name=='cpython'",
"eth-hash[pycryptodome];implementation_name=='pypy'",
Expand Down Expand Up @@ -77,7 +77,6 @@
deps['dev'] = (
deps['dev'] +
deps['eth'] +
deps['eth-extra'] +
deps['test'] +
deps['doc'] +
deps['lint']
Expand Down