summaryrefslogtreecommitdiff
path: root/testing/tests/client/test_crypto.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-26 21:26:23 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:17:51 -0200
commitbae95c183e68481db0fe36f066cd14c97bff3013 (patch)
treefa4b45d04c374a62e56c8f6e9de4dc0912c40d67 /testing/tests/client/test_crypto.py
parentfbca1644823acbe4165ad1087db5baed28a6809d (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/tests/client/test_crypto.py')
-rw-r--r--testing/tests/client/test_crypto.py5
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]