make ecdsa and pexpect packages testing-only
This commit is contained in:
parent
75d26b134f
commit
7d89ab199e
4 changed files with 15 additions and 13 deletions
|
|
@ -150,6 +150,10 @@ class Tx(BaseMessage):
|
|||
if not verify_sig(sig, msghash, pubkey):
|
||||
raise ValueError('signature verification failed')
|
||||
case 'ecdsa':
|
||||
import os
|
||||
if not os.getenv('MMGEN_TEST_SUITE'):
|
||||
from ....util import die
|
||||
die(3, 'The `ecdsa` package is unsafe and may be used only in a testing environment')
|
||||
# ecdsa.keys.VerifyingKey.verify_digest():
|
||||
# raises BadSignatureError if the signature is invalid or malformed
|
||||
import ecdsa
|
||||
|
|
|
|||
|
|
@ -61,10 +61,8 @@ install_requires =
|
|||
gmpy2
|
||||
cryptography
|
||||
pynacl
|
||||
ecdsa
|
||||
aiohttp
|
||||
requests
|
||||
pexpect
|
||||
lxml
|
||||
scrypt
|
||||
semantic-version; platform_system != "Windows" # scripts/create-token.py
|
||||
|
|
|
|||
|
|
@ -79,12 +79,6 @@ class unit_tests:
|
|||
Crypto(cfg).encrypt_aes_ctr(b'deadbeef' * 4, b'deadbeef' * 2, b'foo')
|
||||
return True
|
||||
|
||||
def ecdsa(self, name, ut):
|
||||
import ecdsa
|
||||
pko = ecdsa.SigningKey.from_secret_exponent(12345678901234, curve=ecdsa.SECP256k1)
|
||||
pko.get_verifying_key().to_string().hex()
|
||||
return True
|
||||
|
||||
def ripemd160(self, name, ut):
|
||||
import hashlib
|
||||
if hashlib.new.__name__ == 'hashlib_new_wrapper':
|
||||
|
|
@ -109,11 +103,6 @@ class unit_tests:
|
|||
asyncio.run(do())
|
||||
return True
|
||||
|
||||
def pexpect(self, name, ut):
|
||||
import pexpect
|
||||
from pexpect.popen_spawn import PopenSpawn
|
||||
return True
|
||||
|
||||
def scrypt(self, name, ut):
|
||||
passwd, salt = b'foo', b'bar'
|
||||
N, r, p = 4, 8, 16
|
||||
|
|
|
|||
|
|
@ -45,6 +45,17 @@ class unit_tests:
|
|||
network.address.for_p2pkh_wit(hash160_c)
|
||||
return True
|
||||
|
||||
def ecdsa(self, name, ut):
|
||||
import ecdsa
|
||||
pko = ecdsa.SigningKey.from_secret_exponent(12345678901234, curve=ecdsa.SECP256k1)
|
||||
pko.get_verifying_key().to_string().hex()
|
||||
return True
|
||||
|
||||
def pexpect(self, name, ut):
|
||||
import pexpect
|
||||
from pexpect.popen_spawn import PopenSpawn
|
||||
return True
|
||||
|
||||
def monero_python(self, name, ut):
|
||||
from mmgen.util2 import load_cryptodome
|
||||
load_cryptodome()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue