diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-05-18 14:35:23 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-05-18 14:35:23 +0800 |
commit | e7d199684d69c0dbd17ebeaca6a7c9d9ffc7df10 (patch) | |
tree | c9d1fe43130e7700d82505b58244c577620d8465 /cryptography/hazmat/primitives/cmac.py | |
parent | 3884b6afbf484dc49a0ba6fdaf7be4343ed480cf (diff) | |
download | cryptography-e7d199684d69c0dbd17ebeaca6a7c9d9ffc7df10.tar.gz cryptography-e7d199684d69c0dbd17ebeaca6a7c9d9ffc7df10.tar.bz2 cryptography-e7d199684d69c0dbd17ebeaca6a7c9d9ffc7df10.zip |
Make exceptions end with a period consistently
Diffstat (limited to 'cryptography/hazmat/primitives/cmac.py')
-rw-r--r-- | cryptography/hazmat/primitives/cmac.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cryptography/hazmat/primitives/cmac.py b/cryptography/hazmat/primitives/cmac.py index 7f7cc0f0..fa463ae0 100644 --- a/cryptography/hazmat/primitives/cmac.py +++ b/cryptography/hazmat/primitives/cmac.py @@ -26,13 +26,13 @@ class CMAC(object): def __init__(self, algorithm, backend, ctx=None): if not isinstance(backend, CMACBackend): raise UnsupportedAlgorithm( - "Backend object does not implement CMACBackend", + "Backend object does not implement CMACBackend.", _Reasons.BACKEND_MISSING_INTERFACE ) if not isinstance(algorithm, interfaces.BlockCipherAlgorithm): raise TypeError( - "Expected instance of interfaces.BlockCipherAlgorithm" + "Expected instance of interfaces.BlockCipherAlgorithm." ) self._algorithm = algorithm @@ -44,28 +44,28 @@ class CMAC(object): def update(self, data): if self._ctx is None: - raise AlreadyFinalized("Context was already finalized") + raise AlreadyFinalized("Context was already finalized.") if not isinstance(data, bytes): - raise TypeError("data must be bytes") + raise TypeError("data must be bytes.") self._ctx.update(data) def finalize(self): if self._ctx is None: - raise AlreadyFinalized("Context was already finalized") + raise AlreadyFinalized("Context was already finalized.") digest = self._ctx.finalize() self._ctx = None return digest def verify(self, signature): if not isinstance(signature, bytes): - raise TypeError("signature must be bytes") + raise TypeError("signature must be bytes.") digest = self.finalize() if not constant_time.bytes_eq(digest, signature): raise InvalidSignature("Signature did not match digest.") def copy(self): if self._ctx is None: - raise AlreadyFinalized("Context was already finalized") + raise AlreadyFinalized("Context was already finalized.") return CMAC( self._algorithm, backend=self._backend, |