Skip to content

Commit c04233d

Browse files
committed
update comments
1 parent 7e62a58 commit c04233d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Lib/test/test_hmac.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def requires_builtin_sha2():
2929

3030

3131
class ModuleMixin:
32+
"""Mixin with a HMAC module implementation."""
33+
3234
hmac = None
3335

3436

@@ -47,7 +49,7 @@ def setUpClass(cls):
4749

4850
@unittest.skip("no builtin implementation for HMAC for now")
4951
class BuiltinModuleMixin(ModuleMixin):
50-
# TODO(picnixz): uncomment once HACL* HMAC is here
52+
"""Built-in HACL* implementation of HMAC."""
5153

5254
@classmethod
5355
def setUpClass(cls):
@@ -62,6 +64,7 @@ def hmac_new(self, key, msg=None, digestmod=None):
6264
raise NotImplementedError
6365

6466
def bind_hmac_new(self, digestmod):
67+
"""Return a specialization of hmac_new() with a bound digestmod."""
6568
return functools.partial(self.hmac_new, digestmod=digestmod)
6669

6770

@@ -72,11 +75,12 @@ def hmac_digest(self, key, msg=None, digestmod=None):
7275
raise NotImplementedError
7376

7477
def bind_hmac_digest(self, digestmod):
78+
"""Return a specialization of hmac_digest() with a bound digestmod."""
7579
return functools.partial(self.hmac_digest, digestmod=digestmod)
7680

7781

7882
class ThroughObjectMixin(ModuleMixin, CreatorMixin, DigestMixin):
79-
"""Mixin delegating to hmac.HMAC() and hmac.HMAC(...).digest()."""
83+
"""Mixin delegating to <module>.HMAC() and <module>.HMAC(...).digest()."""
8084

8185
def hmac_new(self, key, msg=None, digestmod=None):
8286
return self.hmac.HMAC(key, msg, digestmod=digestmod)
@@ -86,7 +90,7 @@ def hmac_digest(self, key, msg=None, digestmod=None):
8690

8791

8892
class ThroughModuleAPIMixin(ModuleMixin, CreatorMixin, DigestMixin):
89-
"""Mixin delegating to hmac.new() and hmac.digest()."""
93+
"""Mixin delegating to <module>.new() and <module>.digest()."""
9094

9195
def hmac_new(self, key, msg=None, digestmod=None):
9296
return self.hmac.new(key, msg, digestmod=digestmod)

0 commit comments

Comments
 (0)