MCPcopy
hub / github.com/pyca/cryptography / verify

Method verify

src/cryptography/hazmat/primitives/twofactor/hotp.py:78–80  ·  view source on GitHub ↗
(self, hotp: bytes, counter: int)

Source from the content-addressed store, hash-verified

76 return "{0:0{1}}".format(hotp, self._length).encode()
77
78 def verify(self, hotp: bytes, counter: int) -> None:
79 if not constant_time.bytes_eq(self.generate(counter), hotp):
80 raise InvalidToken("Supplied HOTP value does not match.")
81
82 def _dynamic_truncate(self, counter: int) -> int:
83 ctx = hmac.HMAC(self._key, self._algorithm)

Callers 4

test_verifyMethod · 0.95
test_invalid_verifyMethod · 0.95
_verify_signatureMethod · 0.45
verify_cert_signatureMethod · 0.45

Calls 2

generateMethod · 0.95
InvalidTokenClass · 0.90

Tested by 2

test_verifyMethod · 0.76
test_invalid_verifyMethod · 0.76