self.outer = digestmod.new()
self.inner = digestmod.new()
self.digest_size = digestmod.digest_size
-
+
blocksize = 64
ipad = "\x36" * blocksize
opad = "\x5C" * blocksize
method.
"""
return HMAC(key, msg, digestmod)
-
recursive = 1
del context[objid]
return format % _commajoin(components), readable, recursive
-
+
rep = `object`
return rep, (rep and not rep.startswith('<')), 0
unittest.TestCase.__init__(self, *args)
self._dkeys = self._dict.keys()
self._dkeys.sort()
-
+
def test_dumbdbm_creation(self):
for ext in [".dir", ".dat", ".bak"]:
try: os.unlink(self._fname+ext)
keys = self.keys_helper(f)
for key in self._dict:
self.assertEqual(self._dict[key], f[key])
-
+
def keys_helper(self, f):
keys = f.keys()
keys.sort()
h = hmac.HMAC("key", "", sha)
except:
self.fail("Constructor call with sha module raised exception.")
-
+
class SanityTestCase(unittest.TestCase):
def test_default_is_md5(self):
"""Testing if HMAC defaults to MD5 algorithm."""
if __name__ == "__main__":
test_main()
-
#
# Test suite to check compliance with PEP 247, the standard API for
-# hashing algorithms.
+# hashing algorithms.
#
import md5, sha, hmac