diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-05-18 09:30:57 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-05-18 09:30:57 -0700 |
commit | 5a3589249dd5971789fe77fd60337339f21d27a5 (patch) | |
tree | eef6f1501ff7a0cf00fe6551b1976289f25df19c /cryptography/hazmat/primitives/hmac.py | |
parent | d83878320f1006e39408ca449695c7aeee74db89 (diff) | |
parent | f811b6853e8e35f9354f26fd347ec879df5c2b44 (diff) | |
download | cryptography-5a3589249dd5971789fe77fd60337339f21d27a5.tar.gz cryptography-5a3589249dd5971789fe77fd60337339f21d27a5.tar.bz2 cryptography-5a3589249dd5971789fe77fd60337339f21d27a5.zip |
Merge branch 'master' into doc8
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r-- | cryptography/hazmat/primitives/hmac.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py index 0f89df94..026ad3b3 100644 --- a/cryptography/hazmat/primitives/hmac.py +++ b/cryptography/hazmat/primitives/hmac.py @@ -26,7 +26,7 @@ class HMAC(object): def __init__(self, key, algorithm, backend, ctx=None): if not isinstance(backend, HMACBackend): raise UnsupportedAlgorithm( - "Backend object does not implement HMACBackend", + "Backend object does not implement HMACBackend.", _Reasons.BACKEND_MISSING_INTERFACE ) @@ -43,14 +43,14 @@ class HMAC(object): def update(self, msg): if self._ctx is None: - raise AlreadyFinalized("Context was already finalized") + raise AlreadyFinalized("Context was already finalized.") if not isinstance(msg, bytes): - raise TypeError("msg must be bytes") + raise TypeError("msg must be bytes.") self._ctx.update(msg) def copy(self): if self._ctx is None: - raise AlreadyFinalized("Context was already finalized") + raise AlreadyFinalized("Context was already finalized.") return HMAC( self._key, self.algorithm, @@ -60,14 +60,14 @@ class HMAC(object): 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.") |