Skip to content

Commit cf9902f

Browse files
sipapsgreco
authored andcommitted
Swap out hashlib.ripemd160 for own implementation
Github-Pull: 23716 Rebased-From: 5b559dc (cherry picked from commit ea3e028)
1 parent ea53c46 commit cf9902f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/test_framework/script.py

+3-2
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
@@ -29,14 +28,16 @@
2928
uint256_from_str,
3029
)
3130

31+
from .ripemd160 import ripemd160
32+
3233
MAX_SCRIPT_ELEMENT_SIZE = 520
3334
LOCKTIME_THRESHOLD = 500000000
3435
ANNEX_TAG = 0x50
3536

3637
LEAF_VERSION_TAPSCRIPT = 0xc4
3738

3839
def hash160(s):
39-
return hashlib.new('ripemd160', sha256(s)).digest()
40+
return ripemd160(sha256(s))
4041

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

0 commit comments

Comments
 (0)