diff options
author | Victor Shyba <victor1984@riseup.net> | 2016-11-26 21:26:23 -0300 |
---|---|---|
committer | Victor Shyba <victor1984@riseup.net> | 2016-11-28 13:47:30 -0300 |
commit | 2d82d01a95f6da0c3206bf5de083a3aa465eb084 (patch) | |
tree | 106bf139e644982ca82e2c6585d1f381d40e347f /testing | |
parent | a18fd8b0f1c3d49f13c8a1244d0e4f358cd96479 (diff) |
[refactor] simplify _crypto
After adding the streaming decrypt, some classes were doing almost the
same thing. Unified them.
Also fixed some module level variables to upper case and some class name
to camel case.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/client/test_crypto.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/tests/client/test_crypto.py b/testing/tests/client/test_crypto.py index 863873f7..7643f75d 100644 --- a/testing/tests/client/test_crypto.py +++ b/testing/tests/client/test_crypto.py @@ -52,7 +52,7 @@ class AESTest(unittest.TestCase): key = 'A' * 32 fd = BytesIO() - aes = _crypto.AESEncryptor(key, fd) + aes = _crypto.AESConsumer(key, _buffer=fd) iv = aes.iv data = snowden1 @@ -78,7 +78,8 @@ class AESTest(unittest.TestCase): ciphertext = _aes_encrypt(key, iv, data) fd = BytesIO() - aes = _crypto.AESDecryptor(key, iv, fd) + operation = _crypto.AESConsumer.decrypt + aes = _crypto.AESConsumer(key, iv, fd, operation) for i in range(len(ciphertext) / block): chunk = ciphertext[i * block:(i + 1) * block] |