aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-04-15 18:13:51 +0800
committerAyrx <terrycwk1994@gmail.com>2014-04-15 18:13:51 +0800
commitc8368609f018370758a359fca7857bcc421203e6 (patch)
treee288b30f1f3756770f8f9e7d6aa9062bd6b04a3d
parent399fcb543babb8bac6781938d4f6ef93174ea795 (diff)
downloadcryptography-c8368609f018370758a359fca7857bcc421203e6.tar.gz
cryptography-c8368609f018370758a359fca7857bcc421203e6.tar.bz2
cryptography-c8368609f018370758a359fca7857bcc421203e6.zip
Added CMAC interface
-rw-r--r--cryptography/hazmat/primitives/interfaces.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index e70338ba..ec970e68 100644
--- a/cryptography/hazmat/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py
@@ -457,3 +457,23 @@ class KeyDerivationFunction(object):
Checks whether the key generated by the key material matches the
expected derived key. Raises an exception if they do not match.
"""
+
+
+@six.add_metaclass(abc.ABCMeta)
+class CMACContext(object):
+ @abc.abstractmethod
+ def update(self, data):
+ """
+ Processes the provided bytes.
+ """
+
+ def finalize(self):
+ """
+ Returns the results of processing the final block as bytes.
+ """
+
+ @abc.abstractmethod
+ def copy(self):
+ """
+ Return a CMACContext that is a copy of the current context.
+ """