bitcoin/test/functional/test_framework/crypto
Sebastian Falbesoner a8c3454ba1 test: speedup bip324_cipher.py unit test
Executing the unit tests for the bip324_cipher.py module currently
takes quite long (>60 seconds on my notebook). Most time here is spent
in empty plaintext/ciphertext encryption/decryption loops:

    ....
    for _ in range(msg_idx):
        enc_aead.encrypt(b"", b"")
    ...
    for _ in range(msg_idx):
        enc_aead.decrypt(b"", bytes(16))
    ...

Their sole purpose is increasing the FSChaCha20Poly1305 packet
counters in order to trigger rekeying, i.e. the actual
encryption/decryption is not relevant, as the result is thrown away.
This commit speeds up the tests by supporting to pass "None" as
plaintext/ciphertext, indicating to the routines that no actual
encryption/decryption should be done.

master branch:

$ python3 -m unittest ./test/functional/test_framework/crypto/bip324_cipher.py
..
----------------------------------------------------------------------
Ran 2 tests in 64.658s

PR branch:

$ python3 -m unittest ./test/functional/test_framework/crypto/bip324_cipher.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.822s
2024-02-06 01:35:03 +01:00
..
bip324_cipher.py test: speedup bip324_cipher.py unit test 2024-02-06 01:35:03 +01:00
chacha20.py [test/crypto] Add FSChaCha20 python implementation 2023-09-29 17:50:38 +05:30
ellswift.py [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30
ellswift_decode_test_vectors.csv [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30
hkdf.py [test/crypto] Add HMAC-based Key Derivation Function (HKDF) 2023-09-12 09:59:46 +05:30
muhash.py [test/crypto] Use chacha20_block function in data_to_num3072 2023-09-29 17:50:38 +05:30
poly1305.py [test/crypto] Add Poly1305 python implementation 2023-09-29 17:50:38 +05:30
ripemd160.py [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30
secp256k1.py [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30
siphash.py [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30
xswiftec_inv_test_vectors.csv [test] Move test framework crypto functions to crypto/ 2023-09-10 23:16:39 +05:30