@@ -29,6 +29,8 @@ def requires_builtin_sha2():
2929
3030
3131class 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" )
4951class 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
7882class 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
8892class 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