diff options
Diffstat (limited to 'cryptography/hazmat')
-rw-r--r-- | cryptography/hazmat/bindings/openssl/backend.py | 6 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/ciphers/__init__.py (renamed from cryptography/hazmat/primitives/block/__init__.py) | 4 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/ciphers/algorithms.py (renamed from cryptography/hazmat/primitives/block/ciphers.py) | 0 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/ciphers/base.py (renamed from cryptography/hazmat/primitives/block/base.py) | 14 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/ciphers/modes.py (renamed from cryptography/hazmat/primitives/block/modes.py) | 0 |
5 files changed, 14 insertions, 10 deletions
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py index 69ffde16..0c3d22d5 100644 --- a/cryptography/hazmat/bindings/openssl/backend.py +++ b/cryptography/hazmat/bindings/openssl/backend.py @@ -20,10 +20,12 @@ import cffi from cryptography.exceptions import UnsupportedAlgorithm from cryptography.hazmat.primitives import interfaces -from cryptography.hazmat.primitives.block.ciphers import ( +from cryptography.hazmat.primitives.ciphers.algorithms import ( AES, Blowfish, Camellia, CAST5, TripleDES, ) -from cryptography.hazmat.primitives.block.modes import CBC, CTR, ECB, OFB, CFB +from cryptography.hazmat.primitives.ciphers.modes import ( + CBC, CTR, ECB, OFB, CFB +) class Backend(object): diff --git a/cryptography/hazmat/primitives/block/__init__.py b/cryptography/hazmat/primitives/ciphers/__init__.py index 5b8942b6..e5a8ca52 100644 --- a/cryptography/hazmat/primitives/block/__init__.py +++ b/cryptography/hazmat/primitives/ciphers/__init__.py @@ -13,9 +13,9 @@ from __future__ import absolute_import, division, print_function -from cryptography.hazmat.primitives.block.base import BlockCipher +from cryptography.hazmat.primitives.ciphers.base import Cipher __all__ = [ - "BlockCipher", + "Cipher", ] diff --git a/cryptography/hazmat/primitives/block/ciphers.py b/cryptography/hazmat/primitives/ciphers/algorithms.py index 8046bd26..8046bd26 100644 --- a/cryptography/hazmat/primitives/block/ciphers.py +++ b/cryptography/hazmat/primitives/ciphers/algorithms.py diff --git a/cryptography/hazmat/primitives/block/base.py b/cryptography/hazmat/primitives/ciphers/base.py index ece3b32d..1599308c 100644 --- a/cryptography/hazmat/primitives/block/base.py +++ b/cryptography/hazmat/primitives/ciphers/base.py @@ -16,26 +16,28 @@ from __future__ import absolute_import, division, print_function from cryptography.hazmat.primitives import interfaces -class BlockCipher(object): - def __init__(self, cipher, mode, backend=None): - super(BlockCipher, self).__init__() +class Cipher(object): + def __init__(self, algorithm, mode, backend=None): + super(Cipher, self).__init__() if backend is None: from cryptography.hazmat.bindings import ( _default_backend as backend, ) - self.cipher = cipher + self.algorithm = algorithm self.mode = mode self._backend = backend def encryptor(self): return _CipherContext( - self._backend.ciphers.create_encrypt_ctx(self.cipher, self.mode)) + self._backend.ciphers.create_encrypt_ctx(self.algorithm, + self.mode)) def decryptor(self): return _CipherContext( - self._backend.ciphers.create_decrypt_ctx(self.cipher, self.mode)) + self._backend.ciphers.create_decrypt_ctx(self.algorithm, + self.mode)) @interfaces.register(interfaces.CipherContext) diff --git a/cryptography/hazmat/primitives/block/modes.py b/cryptography/hazmat/primitives/ciphers/modes.py index a60e8a34..a60e8a34 100644 --- a/cryptography/hazmat/primitives/block/modes.py +++ b/cryptography/hazmat/primitives/ciphers/modes.py |