aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory Haynes <greg@greghaynes.net>2014-12-30 22:14:39 -0800
committerGregory Haynes <greg@greghaynes.net>2014-12-30 22:14:39 -0800
commit8487266a34bba8fdebc23281715a62a475406aa6 (patch)
tree959910dcbf8e63fb36628a396c05a370be1a60b3
parent6829d7e54a72590cdc0d0af09d908a795df22d0a (diff)
downloadcryptography-8487266a34bba8fdebc23281715a62a475406aa6.tar.gz
cryptography-8487266a34bba8fdebc23281715a62a475406aa6.tar.bz2
cryptography-8487266a34bba8fdebc23281715a62a475406aa6.zip
Move ModeAuthenticationWithTag into ciphers
This class should be broken out into the ciphers module as well.
-rw-r--r--src/cryptography/hazmat/primitives/interfaces/__init__.py11
-rw-r--r--src/cryptography/hazmat/primitives/interfaces/ciphers.py9
2 files changed, 11 insertions, 9 deletions
diff --git a/src/cryptography/hazmat/primitives/interfaces/__init__.py b/src/cryptography/hazmat/primitives/interfaces/__init__.py
index 6dedd1f8..2f9880da 100644
--- a/src/cryptography/hazmat/primitives/interfaces/__init__.py
+++ b/src/cryptography/hazmat/primitives/interfaces/__init__.py
@@ -12,6 +12,7 @@ from cryptography.hazmat.primitives.interfaces.ciphers import (
BlockCipherAlgorithm,
CipherAlgorithm,
Mode,
+ ModeWithAuthenticationTag,
ModeWithInitializationVector,
ModeWithNonce)
@@ -19,21 +20,13 @@ __all__ = [
"BlockCipherAlgorithm",
"CipherAlgorithm",
"Mode",
+ "ModeWithAuthenticationTag",
"ModeWithInitializationVector",
"ModeWithNonce"
]
@six.add_metaclass(abc.ABCMeta)
-class ModeWithAuthenticationTag(object):
- @abc.abstractproperty
- def tag(self):
- """
- The value of the tag supplied to the constructor of this mode.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
class CipherContext(object):
@abc.abstractmethod
def update(self, data):
diff --git a/src/cryptography/hazmat/primitives/interfaces/ciphers.py b/src/cryptography/hazmat/primitives/interfaces/ciphers.py
index df6d5f74..075a9c25 100644
--- a/src/cryptography/hazmat/primitives/interfaces/ciphers.py
+++ b/src/cryptography/hazmat/primitives/interfaces/ciphers.py
@@ -65,3 +65,12 @@ class ModeWithNonce(object):
"""
The value of the nonce for this mode as bytes.
"""
+
+
+@six.add_metaclass(abc.ABCMeta)
+class ModeWithAuthenticationTag(object):
+ @abc.abstractproperty
+ def tag(self):
+ """
+ The value of the tag supplied to the constructor of this mode.
+ """