diff options
-rw-r--r-- | cryptography/bindings/openssl/api.py | 2 | ||||
-rw-r--r-- | cryptography/primitives/block/modes.py | 6 | ||||
-rw-r--r-- | cryptography/primitives/interfaces.py | 4 | ||||
-rw-r--r-- | docs/primitives/symmetric-encryption.rst | 14 |
4 files changed, 11 insertions, 15 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index af7fe438..917c1846 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -76,8 +76,6 @@ class API(object): assert evp_cipher != self._ffi.NULL if isinstance(mode, interfaces.ModeWithInitializationVector): iv_nonce = mode.initialization_vector - elif isinstance(mode, interfaces.ModeWithNonce): - iv_nonce = mode.nonce else: iv_nonce = self._ffi.NULL diff --git a/cryptography/primitives/block/modes.py b/cryptography/primitives/block/modes.py index 0f17a1a5..9cfbca64 100644 --- a/cryptography/primitives/block/modes.py +++ b/cryptography/primitives/block/modes.py @@ -31,9 +31,9 @@ class ECB(object): class OFB(object): name = "OFB" - def __init__(self, nonce): + def __init__(self, initialization_vector): super(OFB, self).__init__() - self.nonce = nonce + self.initialization_vector = initialization_vector class CFB(object): @@ -45,5 +45,5 @@ class CFB(object): interfaces.ModeWithInitializationVector.register(CBC) -interfaces.ModeWithNonce.register(OFB) +interfaces.ModeWithInitializationVector.register(OFB) interfaces.ModeWithInitializationVector.register(CFB) diff --git a/cryptography/primitives/interfaces.py b/cryptography/primitives/interfaces.py index c1fc9910..6f74ccf7 100644 --- a/cryptography/primitives/interfaces.py +++ b/cryptography/primitives/interfaces.py @@ -20,7 +20,3 @@ import six class ModeWithInitializationVector(six.with_metaclass(abc.ABCMeta)): pass - - -class ModeWithNonce(six.with_metaclass(abc.ABCMeta)): - pass diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst index be86229b..46d7c07c 100644 --- a/docs/primitives/symmetric-encryption.rst +++ b/docs/primitives/symmetric-encryption.rst @@ -68,16 +68,18 @@ Modes reuse an ``initialization_vector`` with a given ``key``. -.. class:: cryptography.primitives.block.modes.OFB(nonce) +.. class:: cryptography.primitives.block.modes.OFB(initialization_vector) OFB (Output Feedback) is a mode of operation for block ciphers. It transforms a block cipher into a stream cipher. - :param bytes nonce: Must be random bytes. They do not need to be kept - secret (they can be included in a transmitted message). - Must be the same number of bytes as the ``block_size`` - of the cipher. Reuse of a ``nonce`` with a given - ``key`` can allow recovery of the original plaintext. + :param bytes initialization_vector: Must be random bytes. They do not need + to be kept secret (they can be included + in a transmitted message). Must be the + same number of bytes as the + ``block_size`` of the cipher. Do not + reuse an ``initialization_vector`` with + a given ``key``. .. class:: cryptography.primitives.block.modes.CFB(initialization_vector) |