Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/cryptography/hazmat/primitives/constant_time.py: 50%
6 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 07:26 +0000
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-08 07:26 +0000
1# This file is dual licensed under the terms of the Apache License, Version
2# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3# for complete details.
5from __future__ import annotations
7import hmac
10def bytes_eq(a: bytes, b: bytes) -> bool:
11 if not isinstance(a, bytes) or not isinstance(b, bytes):
12 raise TypeError("a and b must be bytes.")
14 return hmac.compare_digest(a, b)