From c8368609f018370758a359fca7857bcc421203e6 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Tue, 15 Apr 2014 18:13:51 +0800 Subject: Added CMAC interface --- cryptography/hazmat/primitives/interfaces.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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. + """ -- cgit v1.2.3