dependencies: rm pyaes from requirements
Since #6014, pyaes is not really needed anymore. As we currently require either one of pycryptodomex or cryptography, even if pyaes is available, it will not be used. We could strip it out completely from crypto.py... In any case, pyaes is still pulled in by some hw wallet dependencies indirectly; but the core library no longer depends on it.
This commit is contained in:
@@ -46,18 +46,21 @@ def needs_test_with_all_aes_implementations(func):
|
||||
return
|
||||
has_cryptodome = crypto.HAS_CRYPTODOME
|
||||
has_cryptography = crypto.HAS_CRYPTOGRAPHY
|
||||
has_pyaes = crypto.HAS_PYAES
|
||||
try:
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY) = False, False
|
||||
func(*args, **kwargs) # pyaes
|
||||
if has_pyaes:
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY, crypto.HAS_PYAES) = False, False, True
|
||||
func(*args, **kwargs) # pyaes
|
||||
if has_cryptodome:
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY) = True, False
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY, crypto.HAS_PYAES) = True, False, False
|
||||
func(*args, **kwargs) # cryptodome
|
||||
if has_cryptography:
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY) = False, True
|
||||
(crypto.HAS_CRYPTODOME, crypto.HAS_CRYPTOGRAPHY, crypto.HAS_PYAES) = False, True, False
|
||||
func(*args, **kwargs) # cryptography
|
||||
finally:
|
||||
crypto.HAS_CRYPTODOME = has_cryptodome
|
||||
crypto.HAS_CRYPTOGRAPHY = has_cryptography
|
||||
crypto.HAS_PYAES = has_pyaes
|
||||
return run_test
|
||||
|
||||
|
||||
@@ -101,6 +104,10 @@ class Test_bitcoin(ElectrumTestCase):
|
||||
# we want the unit testing framework to test with cryptography available.
|
||||
self.assertTrue(bool(crypto.HAS_CRYPTOGRAPHY))
|
||||
|
||||
def test_pyaes_is_available(self):
|
||||
# we want the unit testing framework to test with pyaes available.
|
||||
self.assertTrue(bool(crypto.HAS_PYAES))
|
||||
|
||||
@needs_test_with_all_aes_implementations
|
||||
def test_crypto(self):
|
||||
for message in [b"Chancellor on brink of second bailout for banks", b'\xff'*512]:
|
||||
|
||||
Reference in New Issue
Block a user