From 7a94dc3af7fee9edd934affd26c7a2a87304af1c Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 1 Oct 2020 16:23:17 +0200 Subject: [PATCH] tests: simplify deterministic encryption test --- tests/test_crypto.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/tests/test_crypto.py b/tests/test_crypto.py index 0f6af22ce..f2e813068 100644 --- a/tests/test_crypto.py +++ b/tests/test_crypto.py @@ -58,22 +58,10 @@ def test_deterministic_encryption(): for hash_name in ['md5', 'sha1', 'sha256', 'sha384', 'sha512']: for count in [1, 50]: - crypted1 = crypto.aes_base64url_deterministic_encrypt(key, raw, salt, - hash_name=hash_name, count=count) - crypted2 = crypto.aes_base64url_deterministic_encrypt(key, raw, salt, - hash_name=hash_name, count=count) + crypted1 = crypto.aes_base64url_deterministic_encrypt(key, raw, salt, hash_name=hash_name, count=count) + crypted2 = crypto.aes_base64url_deterministic_encrypt(key, raw, salt, hash_name=hash_name, count=count) assert crypted1 == crypted2 - - t = time.time() - for i in range(100): - crypted1 = crypto.aes_base64url_deterministic_encrypt(key, raw, salt, - hash_name=hash_name, - count=count) - - t = time.time() - for i in range(1000): - assert crypto.aes_base64url_deterministic_decrypt(key, crypted1, salt, - max_count=count) == raw + assert crypto.aes_base64url_deterministic_decrypt(key, crypted1, salt, max_count=count) == raw def test_hmac_url():