Description: Use new cryptodome path
 Use the cryptodome Debian namespace.
Author: Manuel Guerra <ar.manuelguerra@gmail.com>
Forwarded: https://github.com/ethereum/eth-hash/pull/65
Last-Update: 2025-07-04

--- a/eth_hash/backends/pycryptodome.py
+++ b/eth_hash/backends/pycryptodome.py
@@ -3,9 +3,19 @@ from typing import (
     cast,
 )
 
-from Crypto.Hash import (
-    keccak,
-)
+try:
+    from Cryptodome.Hash import (
+        keccak,
+    )
+except ImportError:
+    try:
+        from Crypto.Hash import (
+            keccak,
+        )
+    except ImportError as exc:
+        raise ImportError(
+            "Could not import either 'Cryptodome' or 'Crypto' namespace. "
+            "Please install pycryptodome package.") from exc
 
 from eth_hash.abc import (
     BackendAPI,
--- a/tests/core/test_import_and_version.py
+++ b/tests/core/test_import_and_version.py
@@ -25,7 +25,15 @@ def test_import_auto_empty_crash(monkeyp
         keccak,
     )
 
-    with mock.patch.dict("sys.modules", {"sha3": None, "Crypto.Hash": None}):
+    clean_module("eth_hash.backends.pycryptodome")
+    clean_module("eth_hash.backends.pysha3")
+
+    with mock.patch.dict("sys.modules", {
+        "sha3": None,
+        "Crypto": None,
+        "Cryptodome": None,
+        "eth_hash.backends": mock.MagicMock()
+    }):
         with pytest.raises(
             ImportError, match="None of these hashing backends are installed"
         ):
@@ -53,7 +61,15 @@ def test_load_by_env(monkeypatch, backen
     )
 
     monkeypatch.setenv("ETH_HASH_BACKEND", backend)
-    with mock.patch.dict("sys.modules", {"sha3": None, "Crypto.Hash": None}):
+    clean_module("eth_hash.backends.pycryptodome")
+    clean_module("eth_hash.backends.pysha3")
+
+    with mock.patch.dict("sys.modules", {
+        "sha3": None,
+        "Crypto": None,
+        "Cryptodome": None,
+        "eth_hash.backends": mock.MagicMock()
+    }):
         with pytest.raises(ImportError) as excinfo:
             keccak(b"triggered")
     expected_msg = (
