activate RIPEMD-160 code, add tests
This commit is contained in:
parent
40d90b37b8
commit
4dd799104b
5 changed files with 13 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
April 2022
|
||||
May 2022
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
13.1.dev27
|
||||
13.1.dev28
|
||||
|
|
|
|||
|
|
@ -326,6 +326,9 @@ def init(
|
|||
from .term import init_term
|
||||
init_term()
|
||||
|
||||
from .util import wrap_ripemd160
|
||||
wrap_ripemd160() # ripemd160 used by cfg_file()
|
||||
|
||||
if not (opt.skip_cfg_file or opt.bob or opt.alice or g.prog_name == 'mmgen-regtest'):
|
||||
from .cfg import cfg_file
|
||||
# check for changes in system template file - term must be initialized
|
||||
|
|
|
|||
|
|
@ -292,6 +292,7 @@ t_hash="
|
|||
256 $python test/hashfunc.py sha256 $rounds_max
|
||||
512 $python test/hashfunc.py sha512 $rounds_max # native SHA512 - not used by the MMGen wallet
|
||||
keccak $python test/hashfunc.py keccak $rounds_max
|
||||
ripemd160 $python mmgen/contrib/ripemd160.py $VERBOSE
|
||||
"
|
||||
f_hash='Hash function tests completed'
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,13 @@ class unit_tests:
|
|||
pubkey = pko.get_verifying_key().to_string().hex()
|
||||
return True
|
||||
|
||||
def ripemd160(self,name,ut):
|
||||
import hashlib
|
||||
if hashlib.new.__name__ == 'hashlib_new_wrapper':
|
||||
ymsg('Warning: RIPEMD160 missing in hashlib, falling back on pure-Python implementation')
|
||||
hashlib.new('ripemd160')
|
||||
return True
|
||||
|
||||
def gmpy(self,name,ut):
|
||||
from gmpy2 import context,set_context,sqrt,cbrt
|
||||
# context() parameters are platform-dependent!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue