Check that OpenSSL HMAC interface is enabled/disabled.
(self, name, *, disabled=True)
| 913 | _ = do_hash(b"") |
| 914 | |
| 915 | def check_openssl_hmac(self, name, *, disabled=True): |
| 916 | """Check that OpenSSL HMAC interface is enabled/disabled.""" |
| 917 | if name in hashlib_helper.NON_HMAC_DIGEST_NAMES: |
| 918 | # HMAC-BLAKE and HMAC-SHAKE raise a ValueError as they are not |
| 919 | # supported at all (they do not make any sense in practice). |
| 920 | with self.assertRaises(ValueError): |
| 921 | self._hashlib.hmac_digest(b"", b"", name) |
| 922 | else: |
| 923 | with self.check_context(disabled): |
| 924 | _ = self._hashlib.hmac_digest(b"", b"", name) |
| 925 | # OpenSSL does not provide one-shot explicit HMAC functions |
| 926 | |
| 927 | def check_builtin_hash(self, name, *, disabled=True): |
| 928 | """Check that HACL* HASH interface is enabled/disabled.""" |
no test coverage detected