示例#1
0
 def test_sha256_iterated(self):
     h = Hash.sha256_new()
     h.update('a')
     h.update('b')
     h.update('c')
     digest = h.digest()
     expected = b'\xba\x78\x16\xbf\x8f\x01\xcf\xea\x41\x41\x40\xde\x5d\xae\x22\x23\xb0\x03\x61\xa3\x96\x17\x7a\x9c\xb4\x10\xff\x61\xf2\x00\x15\xad'
     self.assertEqual(expected, digest)
示例#2
0
 def test_sha256_empty(self):
     h = Hash.sha256_new()
     digest = h.digest()
     expected = b'\xe3\xb0\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24\x27\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55'
     self.assertEqual(expected, digest)