8 int SHA1_testSetup(void)
14 int SHA1_testTearDown(void)
19 int SHA1_testRun(void)
25 hash_begin(&context.h);
26 hash_update(&context.h, "abc", 3);
27 ASSERT(memcmp(hash_final(&context.h), "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D", 20) == 0);
29 hash_begin(&context.h);
30 hash_update(&context.h, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 56);
31 ASSERT(memcmp(hash_final(&context.h), "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1", 20) == 0);
33 hash_begin(&context.h);
34 for (i = 0; i < 1000000; i++)
35 hash_update(&context.h, "a", 1);
36 ASSERT(memcmp(hash_final(&context.h), "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F", 20) == 0);