mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-06 02:38:11 +01:00
docker: Manually install protobuf to avoid error.
Error: "TypeError: Descriptors cannot not be created directly" Use pycryptodome ripemd160 implementation else it must be manually enabled in hashlib/openssl.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import hashlib
|
||||
from basicswap.contrib.segwit_addr import bech32_decode, convertbits, bech32_encode
|
||||
|
||||
from basicswap.util.crypto import ripemd160
|
||||
|
||||
__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
||||
|
||||
@@ -89,7 +89,7 @@ def toWIF(prefix_byte, b, compressed=True):
|
||||
|
||||
def getKeyID(bytes):
|
||||
data = hashlib.sha256(bytes).digest()
|
||||
return hashlib.new('ripemd160', data).digest()
|
||||
return ripemd160(data)
|
||||
|
||||
|
||||
def bech32Decode(hrp, addr):
|
||||
|
||||
13
basicswap/util/crypto.py
Normal file
13
basicswap/util/crypto.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2022 tecnovert
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
from Crypto.Hash import RIPEMD160 # pycryptodome
|
||||
|
||||
|
||||
def ripemd160(data):
|
||||
h = RIPEMD160.new()
|
||||
h.update(data)
|
||||
return h.digest()
|
||||
Reference in New Issue
Block a user