From 99690a6145650c6ff147cf4b1b5e2dc8a2639a2e Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 16 Mar 2019 00:59:27 +0100 Subject: [PATCH] Test longer string signing --- src/Test/TestCryptBitcoin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Test/TestCryptBitcoin.py b/src/Test/TestCryptBitcoin.py index 54195c93..cb0a8336 100644 --- a/src/Test/TestCryptBitcoin.py +++ b/src/Test/TestCryptBitcoin.py @@ -34,9 +34,11 @@ class TestCryptBitcoin: assert address_bad != "1MpDMxFeDUkiHohxx9tbGLeEGEuR4ZNsJz" # Text signing - for pad_len in range(0, 300, 10): - pad = pad_len * "!" - sign = CryptBitcoin.sign("hello" + pad, privatekey) + data_len_list = list(range(0, 300, 10)) + data_len_list+= [1024, 2048, 1024 * 128, 1024 * 1024, 1024 * 2048] + for data_len in data_len_list: + data = data_len * "!" + sign = crypt_bitcoin_lib.sign(data, privatekey) assert crypt_bitcoin_lib.verify(data, address, sign) assert not crypt_bitcoin_lib.verify("invalid" + data, address, sign)