Skip to content

Commit 879cc73

Browse files
committed
typo
1 parent 20c9103 commit 879cc73

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Lib/test/support/hashlib_helper.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
))
3030

3131
NON_HMAC_DIGEST_NAMES = frozenset({
32-
'shake_128', 'shake_256', 'blake2s', 'blake2b'
32+
'shake_128', 'shake_256',
33+
'blake2s', 'blake2b',
3334
})
3435

35-
# Mapping from a "canonical" name to a pair (HACL*, _hashlib.*, hashlib.*)
36-
# constructors. If the constructor name is None, then this means that the
37-
# algorithm can only be used by the "agile" new() interfaces.
3836

3937
class HashAPI(namedtuple("HashAPI", "builtin openssl hashlib")):
4038

@@ -50,6 +48,9 @@ def fullname(self, typ):
5048
raise AssertionError(f"unknown type: {typ}")
5149

5250

51+
# Mapping from a "canonical" name to a pair (HACL*, _hashlib.*, hashlib.*)
52+
# constructors. If the constructor name is None, then this means that the
53+
# algorithm can only be used by the "agile" new() interfaces.
5354
_EXPLICIT_CONSTRUCTORS = MappingProxyType({
5455
"md5": HashAPI("_md5.md5", "openssl_md5", "md5"),
5556
"sha1": HashAPI("_sha1.sha1", "openssl_sha1", "sha1"),
@@ -66,7 +67,6 @@ def fullname(self, typ):
6667
"blake2s": HashAPI("_blake2.blake2s", None, "blake2s"),
6768
"blake2b": HashAPI("_blake2.blake2b", None, "blake2b"),
6869
})
69-
7070
assert _EXPLICIT_CONSTRUCTORS.keys() == CANONICAL_DIGEST_NAMES
7171

7272
_EXPLICIT_HMAC_CONSTRUCTORS = {
@@ -78,6 +78,8 @@ def fullname(self, typ):
7878
}
7979
_EXPLICIT_HMAC_CONSTRUCTORS['shake_128'] = None
8080
_EXPLICIT_HMAC_CONSTRUCTORS['shake_256'] = None
81+
# Strictly speaking, HMAC-BLAKE is meaningless as BLAKE2 is already a
82+
# keyed hash function. However, as it's exposed by HACL*, we test it.
8183
_EXPLICIT_HMAC_CONSTRUCTORS['blake2s'] = '_hmac.compute_blake2s_32'
8284
_EXPLICIT_HMAC_CONSTRUCTORS['blake2b'] = '_hmac.compute_blake2b_32'
8385
_EXPLICIT_HMAC_CONSTRUCTORS = MappingProxyType(_EXPLICIT_HMAC_CONSTRUCTORS)

0 commit comments

Comments
 (0)