diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-05-17 19:47:09 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-05-17 19:47:09 +0800 |
commit | 00eff9ca7fece942670429824cb77dd532190c96 (patch) | |
tree | 6fdc0df70cd1bbecd56049208899111a8edcd202 /cryptography/hazmat/primitives/cmac.py | |
parent | 6d69eab6caff7b87d32fab3c7178296e481eb8a4 (diff) | |
download | cryptography-00eff9ca7fece942670429824cb77dd532190c96.tar.gz cryptography-00eff9ca7fece942670429824cb77dd532190c96.tar.bz2 cryptography-00eff9ca7fece942670429824cb77dd532190c96.zip |
Simplified exception message
Diffstat (limited to 'cryptography/hazmat/primitives/cmac.py')
-rw-r--r-- | cryptography/hazmat/primitives/cmac.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/cryptography/hazmat/primitives/cmac.py b/cryptography/hazmat/primitives/cmac.py index cc8e8f2c..b01c5170 100644 --- a/cryptography/hazmat/primitives/cmac.py +++ b/cryptography/hazmat/primitives/cmac.py @@ -48,10 +48,7 @@ class CMAC(object): if self._ctx is None: raise AlreadyFinalized("Context was already finalized") if not isinstance(data, six.binary_type): - raise TypeError( - "data must be binary type. This is str in Python 2 and bytes " - "in Python 3" - ) + raise TypeError("data must be bytes") self._ctx.update(data) def finalize(self): @@ -63,10 +60,7 @@ class CMAC(object): def verify(self, signature): if not isinstance(signature, six.binary_type): - raise TypeError( - "signature must be binary type. This is str in Python 2 and " - "bytes in Python 3" - ) + raise TypeError("signature must be bytes") digest = self.finalize() if not constant_time.bytes_eq(digest, signature): raise InvalidSignature("Signature did not match digest.") |