diff options
| author | Donald Stufft <donald@stufft.io> | 2013-09-12 10:43:56 -0700 |
|---|---|---|
| committer | Donald Stufft <donald@stufft.io> | 2013-09-12 10:43:56 -0700 |
| commit | bc1994db98320fb82155df1f1da619177cc59979 (patch) | |
| tree | b88ba6a356d39dbc0676279127ed714fe830a2ef /cryptography | |
| parent | b3137ff089f1750e1a5da003aecbbf0aeba63890 (diff) | |
| parent | f1a39bd77ff8ea5fda5a24616c3fc9a9199be633 (diff) | |
| download | cryptography-bc1994db98320fb82155df1f1da619177cc59979.tar.gz cryptography-bc1994db98320fb82155df1f1da619177cc59979.tar.bz2 cryptography-bc1994db98320fb82155df1f1da619177cc59979.zip | |
Merge pull request #60 from dreid/ofb-iv-not-nonce
OFB uses an IV instead of a nonce.
Diffstat (limited to 'cryptography')
| -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 |
3 files changed, 3 insertions, 9 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 |
