Skip to content

Commit 96d6de3

Browse files
committed
better comment
1 parent c4ea94a commit 96d6de3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Lib/test/support/hashlib_helper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ def fullname(self, implementation):
169169
# There is currently no OpenSSL one-shot named function and there will likely
170170
# be none in the future.
171171
_EXPLICIT_HMAC_CONSTRUCTORS = {
172-
hid: None if hid.is_xof else f"_hmac.compute_{hid!s}"
173-
# names slightly differ for keyed hash functions
174-
for hid in HID if not hid.is_keyed
172+
HID(name): f"_hmac.compute_{name}"
173+
for name in CANONICAL_DIGEST_NAMES
175174
}
175+
# Neither HACL* nor OpenSSL supports HMAC over XOFs.
176+
_EXPLICIT_HMAC_CONSTRUCTORS[HID.shake_128] = None
177+
_EXPLICIT_HMAC_CONSTRUCTORS[HID.shake_256] = None
176178
# Strictly speaking, HMAC-BLAKE is meaningless as BLAKE2 is already a
177179
# keyed hash function. However, as it's exposed by HACL*, we test it.
178180
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2s] = "_hmac.compute_blake2s_32"

0 commit comments

Comments
 (0)