Lines Matching refs:digestmod
38 def __init__(self, key, msg=None, digestmod=''):
43 digestmod: A hash name suitable for hashlib.new(). *OR*
55 if not digestmod:
56 raise TypeError("Missing required parameter 'digestmod'.")
58 if _hashopenssl and isinstance(digestmod, (str, _functype)):
60 self._init_hmac(key, msg, digestmod)
62 self._init_old(key, msg, digestmod)
64 self._init_old(key, msg, digestmod)
66 def _init_hmac(self, key, msg, digestmod):
67 self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod)
71 def _init_old(self, key, msg, digestmod):
72 if callable(digestmod):
73 digest_cons = digestmod
74 elif isinstance(digestmod, str):
75 digest_cons = lambda d=b'': _hashlib.new(digestmod, d)
77 digest_cons = lambda d=b'': digestmod.new(d)
167 def new(key, msg=None, digestmod=''):
172 digestmod: A hash name suitable for hashlib.new(). *OR*
184 return HMAC(key, msg, digestmod)