Home | History | Annotate | Download | only in test

Lines Matching refs:hmac

1 import hmac
10 # Test the HMAC module against test vectors from the RFC.
13 h = hmac.HMAC(key, data)
47 h = hmac.HMAC(key, data, digestmod=hashlib.sha1)
81 h = hmac.HMAC(key, data, digestmod=hashfunc)
176 'd by the HMAC algorithm.',
217 hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
222 hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
233 h = hmac.HMAC("key")
240 h = hmac.HMAC("key", "hash this!")
247 h = hmac.HMAC("key", "", hashlib.sha1)
254 # Testing if HMAC defaults to MD5 algorithm.
255 # NOTE: this whitebox test depends on the hmac class internals
256 h = hmac.HMAC("key")
263 h = hmac.HMAC("my secret key")
269 self.fail("Exception raised during normal usage of HMAC class.")
275 h1 = hmac.HMAC("key")
286 h1 = hmac.HMAC("key")
289 self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.")
297 h1 = hmac.HMAC("key")