mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Swap out hashlib.ripemd160 for own implementation
Github-Pull: 23716
Rebased-From: 5b559dc7ec
This commit is contained in:
parent
0f6967033d
commit
069bec11b3
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
@ -29,6 +28,8 @@ from .messages import (
|
|||
uint256_from_str,
|
||||
)
|
||||
|
||||
from .ripemd160 import ripemd160
|
||||
|
||||
MAX_SCRIPT_ELEMENT_SIZE = 520
|
||||
LOCKTIME_THRESHOLD = 500000000
|
||||
ANNEX_TAG = 0x50
|
||||
|
|
@ -36,7 +37,7 @@ ANNEX_TAG = 0x50
|
|||
LEAF_VERSION_TAPSCRIPT = 0xc4
|
||||
|
||||
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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue