We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27fa0e8 commit 3a5ec11Copy full SHA for 3a5ec11
1 file changed
bitcoin/core/serialize.py
@@ -20,6 +20,8 @@
20
21
from io import BytesIO
22
23
+from bitcoin.core.contrib.ripemd160 import ripemd160
24
+
25
MAX_SIZE = 0x02000000
26
27
@@ -29,17 +31,6 @@ def Hash(msg):
29
31
30
32
def Hash160(msg):
33
"""RIPEME160(SHA256(msg)) -> bytes"""
- try:
- # This will fail with newer versions of OpenSSL such as included in
34
- # Ubuntu 22.04 as OpenSSL no longer includes ripemd160 by default.
35
- hashlib.new('ripemd160')
36
- def ripemd160(msg):
37
- return hashlib.new('ripemd160', msg).digest()
38
- except:
39
- # If OpenSSL ripemd160 provided by hashlib fails, use the pure
40
- # python implementation instead
41
- from bitcoin.core.contrib.ripemd160 import ripemd160
42
-
43
return ripemd160(hashlib.sha256(msg).digest())
44
45
class SerializationError(Exception):
0 commit comments