diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-12-08 14:17:08 -0500 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-07-04 11:51:43 +0100 |
commit | bf79f08d97e2225a8a1116ede8425bb34ce8b23f (patch) | |
tree | 53d4f05e6603dd623aa641766c4041893db5c718 | |
parent | 6bfa0bef48d231b0aa7befee86834d5652809fbf (diff) |
Swap out hashlib.ripemd160 for own implementation
Github-Pull: #23716
Rebased-From: 5b559dc7ecf37ab1604b75ec8ffe8436377a5fb1
-rw-r--r-- | test/functional/test_framework/script.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py index 8e5848d493..321277dbf3 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 @@ -34,7 +35,7 @@ OPCODE_NAMES = {} # type: Dict[CScriptOp, str] 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.""" |