aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorJulian Krause <julian.krause@gmail.com>2013-12-25 11:00:49 -0800
committerJulian Krause <julian.krause@gmail.com>2013-12-25 11:00:49 -0800
commitc91fe6a21fbae3107de7b2e53b7343cd67ac8c6d (patch)
treed63eddf0364329af999a930100a828817bacfc5f /cryptography
parent2288e30119e2af3e2b448345cf6a9e61f8d06aa0 (diff)
downloadcryptography-c91fe6a21fbae3107de7b2e53b7343cd67ac8c6d.tar.gz
cryptography-c91fe6a21fbae3107de7b2e53b7343cd67ac8c6d.tar.bz2
cryptography-c91fe6a21fbae3107de7b2e53b7343cd67ac8c6d.zip
Clean up documentation and naming.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/primitives/hashes.py10
-rw-r--r--cryptography/hazmat/primitives/hmac.py6
2 files changed, 8 insertions, 8 deletions
diff --git a/cryptography/hazmat/primitives/hashes.py b/cryptography/hazmat/primitives/hashes.py
index b3c626d4..c71377d7 100644
--- a/cryptography/hazmat/primitives/hashes.py
+++ b/cryptography/hazmat/primitives/hashes.py
@@ -55,12 +55,12 @@ class Hash(object):
self._ctx = None
return digest
- def verify(self, sig):
- if isinstance(sig, six.text_type):
+ def verify(self, digest):
+ if isinstance(digest, six.text_type):
raise TypeError("Unicode-objects must be encoded before verifying")
- digest = self.finalize()
- if not constant_time.bytes_eq(digest, sig):
- raise InvalidSignature("Signature did not match digest.")
+ hash_digest = self.finalize()
+ if not constant_time.bytes_eq(digest, hash_digest):
+ raise InvalidSignature("Digest did not match hash digest.")
@utils.register_interface(interfaces.HashAlgorithm)
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py
index 8ade84aa..76d658aa 100644
--- a/cryptography/hazmat/primitives/hmac.py
+++ b/cryptography/hazmat/primitives/hmac.py
@@ -58,9 +58,9 @@ class HMAC(object):
self._ctx = None
return digest
- def verify(self, sig):
- if isinstance(sig, six.text_type):
+ def verify(self, signature):
+ if isinstance(signature, six.text_type):
raise TypeError("Unicode-objects must be encoded before verifying")
digest = self.finalize()
- if not constant_time.bytes_eq(digest, sig):
+ if not constant_time.bytes_eq(digest, signature):
raise InvalidSignature("Signature did not match digest.")