FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-136547: refactor `hashlib_helper` for blocking and requesting digests by picnixz · Pull Request #136762 · python/cpython · GitHub

Repository navigation

Prev Previous commit
Next Next commit
better comment
  • Loading branch information
picnixz committed Jul 19, 2025
commit 96d6de30615934ae279c702e63e6fbc4a86bfabb
8 changes: 5 additions & 3 deletions Lib/test/support/hashlib_helper.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ def fullname(self, implementation):
# There is currently no OpenSSL one-shot named function and there will likely
# be none in the future.
_EXPLICIT_HMAC_CONSTRUCTORS = {
hid: None if hid.is_xof else f"_hmac.compute_{hid!s}"
# names slightly differ for keyed hash functions
for hid in HID if not hid.is_keyed
HID(name): f"_hmac.compute_{name}"
for name in CANONICAL_DIGEST_NAMES
}
# Neither HACL* nor OpenSSL supports HMAC over XOFs.
_EXPLICIT_HMAC_CONSTRUCTORS[HID.shake_128] = None
_EXPLICIT_HMAC_CONSTRUCTORS[HID.shake_256] = None
# Strictly speaking, HMAC-BLAKE is meaningless as BLAKE2 is already a
# keyed hash function. However, as it's exposed by HACL*, we test it.
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2s] = "_hmac.compute_blake2s_32"
Expand Down

Back | FazBrowse Home | New Git URL