From 4ec3f253a81a42e2804831c40f4ac28be4b56577 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 6 Nov 2013 15:20:23 +0800 Subject: rename cipher to algorithm within the Cipher object --- cryptography/hazmat/primitives/ciphers/algorithms.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/primitives/ciphers/algorithms.py b/cryptography/hazmat/primitives/ciphers/algorithms.py index 0b11e466..56dca216 100644 --- a/cryptography/hazmat/primitives/ciphers/algorithms.py +++ b/cryptography/hazmat/primitives/ciphers/algorithms.py @@ -17,7 +17,7 @@ from cryptography.hazmat.primitives import interfaces class Cipher(object): - def __init__(self, cipher, mode, backend=None): + def __init__(self, algorithm, mode, backend=None): super(Cipher, self).__init__() if backend is None: @@ -25,17 +25,19 @@ class Cipher(object): _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) -- cgit v1.2.3