Skip to content

Commit 5b559dc

Browse files
committed
Swap out hashlib.ripemd160 for own implementation
1 parent ad3e9e1 commit 5b559dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/test_framework/script.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"""
99

1010
from collections import namedtuple
11-
import hashlib
1211
import struct
1312
import unittest
1413
from typing import List, Dict
@@ -25,14 +24,16 @@
2524
uint256_from_str,
2625
)
2726

27+
from .ripemd160 import ripemd160
28+
2829
MAX_SCRIPT_ELEMENT_SIZE = 520
2930
LOCKTIME_THRESHOLD = 500000000
3031
ANNEX_TAG = 0x50
3132

3233
LEAF_VERSION_TAPSCRIPT = 0xc0
3334

3435
def hash160(s):
35-
return hashlib.new('ripemd160', sha256(s)).digest()
36+
return ripemd160(sha256(s))
3637

3738
def bn2vch(v):
3839
"""Convert number to bitcoin-specific little endian format."""

0 commit comments

Comments
 (0)