Lines Matching refs:hmac

3 import hmac
47 self.assertEqual(h.name, f"hmac-{hashname}")
54 h = hmac.HMAC(key, data, digestmod=hashfunc)
59 h = hmac.HMAC(key, data, digestmod=hashname)
64 h = hmac.HMAC(key, digestmod=hashname)
70 h = hmac.new(key, data, digestmod=hashname)
75 h = hmac.new(key, None, digestmod=hashname)
79 h = hmac.new(key, digestmod=hashname)
83 h = hmac.new(key, data, digestmod=hashfunc)
87 hmac.digest(key, data, digest=hashname),
91 hmac.digest(key, data, digest=hashfunc),
95 h = hmac.HMAC.__new__(hmac.HMAC)
119 h = hmac.HMAC.__new__(hmac.HMAC)
357 hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
362 hmac.HMAC(b'a', b'b', digestmod=MockCrazyHash)
370 hmac.HMAC(key, data, digestmod=None)
372 hmac.new(key, data)
374 hmac.HMAC(key, msg=data, digestmod='')
380 hexdigest = hmac.digest(b'key', b'message', 'foo').hex()
397 hmac.HMAC(b"key", digestmod='sha256')
406 h = hmac.HMAC("key", digestmod='sha256')
413 h = hmac.new("key", digestmod='sha256')
419 h = hmac.HMAC(b"key", b"hash this!", digestmod='sha256')
427 h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"),
436 h = hmac.HMAC(b"key", memoryview(b"hash this!"), digestmod="sha256")
445 h = hmac.HMAC(b"key", b"", hashlib.sha256)
458 h = hmac.HMAC(b"key", b"hash this!", digestmod=sha256_module.sha256)
460 self.assertEqual(h.name, "hmac-sha256")
462 digest = hmac.digest(b"key", b"hash this!", sha256_module.sha256)
473 h = hmac.HMAC(b"my secret key", digestmod="sha256")
487 h1 = hmac.HMAC.__new__(hmac.HMAC)
498 h1 = hmac.HMAC.__new__(hmac.HMAC)
512 h1 = hmac.HMAC.__new__(hmac.HMAC)
520 h1 = hmac.HMAC(b"key", digestmod="sha256")
530 # Testing if the copy has the same digests with hmac.new().
531 h1 = hmac.new(b"key", digestmod="sha256")
546 self._test_compare_digest(hmac.compare_digest)
548 self.assertIs(hmac.compare_digest, openssl_compare_digest)
550 self.assertIs(hmac.compare_digest, operator_compare_digest)