Skip to content

Commit 03ae667

Browse files
committed
Merge petertodd#282: Fix another usage of openssl's ripemd160
f894632 Fix another usage of openssl's ripemd160 (Pablo Greco) Pull request description: Top commit has no ACKs. Tree-SHA512: f1609522105b5727a59961b788eeddb9b1d69bb6f23f0c1dfabf764f4b41bf4c98d7e4f0f605374fefe11137ed1432ce077d2b07bdded9a82f7431290832dea2
2 parents 3f7c031 + f894632 commit 03ae667

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bitcoin/core/scripteval.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import bitcoin.core._bignum
2424
import bitcoin.core.key
2525
import bitcoin.core.serialize
26+
from bitcoin.core.contrib.ripemd160 import ripemd160
2627

2728
# Importing everything for simplicity; note that we use __all__ at the end so
2829
# we're not exporting the whole contents of the script module.
@@ -624,9 +625,7 @@ def check_args(n):
624625
elif sop == OP_RIPEMD160:
625626
check_args(1)
626627

627-
h = hashlib.new('ripemd160')
628-
h.update(stack.pop())
629-
stack.append(h.digest())
628+
stack.append(ripemd160(stack.pop()))
630629

631630
elif sop == OP_ROT:
632631
check_args(3)

0 commit comments

Comments
 (0)