aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2021-12-08 14:17:08 -0500
committerMacroFake <falke.marco@gmail.com>2022-05-30 17:40:08 +0200
commitea3e028bcc99b2e3ddc4c9e96eb487f4e5418b3f (patch)
tree05ef52398ca4fa8786e8a12c5029e0e1d5d9c93c
parent52036915fa774b80dec853c1c79a302f474d35ac (diff)
downloadbitcoin-ea3e028bcc99b2e3ddc4c9e96eb487f4e5418b3f.tar.xz
Swap out hashlib.ripemd160 for own implementation
Github-Pull: 23716 Rebased-From: 5b559dc7ecf37ab1604b75ec8ffe8436377a5fb1
-rw-r--r--test/functional/test_framework/script.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index 3c9b8a6e69..880bb63679 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -8,7 +8,6 @@ This file is modified from python-bitcoinlib.
"""
from collections import namedtuple
-import hashlib
import struct
import unittest
from typing import List, Dict
@@ -25,6 +24,8 @@ from .messages import (
uint256_from_str,
)
+from .ripemd160 import ripemd160
+
MAX_SCRIPT_ELEMENT_SIZE = 520
LOCKTIME_THRESHOLD = 500000000
ANNEX_TAG = 0x50
@@ -32,7 +33,7 @@ ANNEX_TAG = 0x50
LEAF_VERSION_TAPSCRIPT = 0xc0
def hash160(s):
- return hashlib.new('ripemd160', sha256(s)).digest()
+ return ripemd160(sha256(s))
def bn2vch(v):
"""Convert number to bitcoin-specific little endian format."""