MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_hmac_hexdigest

Method check_hmac_hexdigest

Lib/test/test_hmac.py:350–365  ·  view source on GitHub ↗

Check and return a HMAC digest computed by hmac_digest_func(). This HMAC digest is computed by: hmac_digest_func(key, msg, **hmac_digest_kwds) This is typically useful for checking one-shot HMAC functions.

(
        self, key, msg, hexdigest, digest_size,
        hmac_digest_func, hmac_digest_kwds=types.MappingProxyType({}),
    )

Source from the content-addressed store, hash-verified

348 )
349
350 def check_hmac_hexdigest(
351 self, key, msg, hexdigest, digest_size,
352 hmac_digest_func, hmac_digest_kwds=types.MappingProxyType({}),
353 ):
354 """Check and return a HMAC digest computed by hmac_digest_func().
355
356 This HMAC digest is computed by:
357
358 hmac_digest_func(key, msg, **hmac_digest_kwds)
359
360 This is typically useful for checking one-shot HMAC functions.
361 """
362 d = hmac_digest_func(key, msg, **hmac_digest_kwds)
363 self.assertEqual(len(d), digest_size)
364 self.assertEqual(d, binascii.unhexlify(hexdigest))
365 return d
366
367 def assert_hmac_common_cases(
368 self, key, msg, hexdigest, digestmod, hashname, digest_size, block_size

Callers 3

assert_hmac_hexdigestMethod · 0.95

Calls 2

lenFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected