aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorJulian Krause <julian.krause@gmail.com>2013-12-26 21:47:39 -0800
committerJulian Krause <julian.krause@gmail.com>2013-12-26 21:47:39 -0800
commitb808f8cc91e302d4120eefa80c946a7cdcf9a155 (patch)
treee68b282dfff5ac7cebcdebe27ce82345fe22fbcb /cryptography
parent831467cce6c2a2b916e30914635924042b15ed2d (diff)
downloadcryptography-b808f8cc91e302d4120eefa80c946a7cdcf9a155.tar.gz
cryptography-b808f8cc91e302d4120eefa80c946a7cdcf9a155.tar.bz2
cryptography-b808f8cc91e302d4120eefa80c946a7cdcf9a155.zip
Remove verify from Hash.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/primitives/hashes.py11
-rw-r--r--cryptography/hazmat/primitives/interfaces.py7
2 files changed, 2 insertions, 16 deletions
diff --git a/cryptography/hazmat/primitives/hashes.py b/cryptography/hazmat/primitives/hashes.py
index c71377d7..bee188b3 100644
--- a/cryptography/hazmat/primitives/hashes.py
+++ b/cryptography/hazmat/primitives/hashes.py
@@ -16,8 +16,8 @@ from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
-from cryptography.exceptions import AlreadyFinalized, InvalidSignature
-from cryptography.hazmat.primitives import constant_time, interfaces
+from cryptography.exceptions import AlreadyFinalized
+from cryptography.hazmat.primitives import interfaces
@utils.register_interface(interfaces.HashContext)
@@ -55,13 +55,6 @@ class Hash(object):
self._ctx = None
return digest
- def verify(self, digest):
- if isinstance(digest, six.text_type):
- raise TypeError("Unicode-objects must be encoded before verifying")
- 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)
class SHA1(object):
diff --git a/cryptography/hazmat/primitives/interfaces.py b/cryptography/hazmat/primitives/interfaces.py
index 371701a4..e87c9ca9 100644
--- a/cryptography/hazmat/primitives/interfaces.py
+++ b/cryptography/hazmat/primitives/interfaces.py
@@ -162,10 +162,3 @@ class HashContext(six.with_metaclass(abc.ABCMeta)):
"""
Return a HashContext that is a copy of the current context.
"""
-
- @abc.abstractmethod
- def verify(self, signature):
- """
- Compare hash digest to signature and raises InvalidSignature
- if they are not equal.
- """