MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / sha224_test

Function sha224_test

extra/yassl/taocrypt/test/test.cpp:502–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501
502int sha224_test()
503{
504 SHA224 sha;
505 byte hash[SHA224::DIGEST_SIZE];
506
507 testVector test_sha[] =
508 {
509 testVector("abc",
510 "\x23\x09\x7d\x22\x34\x05\xd8\x22\x86\x42\xa4\x77\xbd\xa2\x55"
511 "\xb3\x2a\xad\xbc\xe4\xbd\xa0\xb3\xf7\xe3\x6c\x9d\xa7"),
512 testVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
513 "\x75\x38\x8b\x16\x51\x27\x76\xcc\x5d\xba\x5d\xa1\xfd\x89\x01"
514 "\x50\xb0\xc6\x45\x5c\xb4\xf5\x8b\x19\x52\x52\x25\x25")
515 };
516
517 int times( sizeof(test_sha) / sizeof(testVector) );
518 for (int i = 0; i < times; ++i) {
519 sha.Update(test_sha[i].input_, test_sha[i].inLen_);
520 sha.Final(hash);
521
522 if (memcmp(hash, test_sha[i].output_, SHA224::DIGEST_SIZE) != 0)
523 return -1 - i;
524 }
525
526 return 0;
527}
528
529
530int md5_test()

Callers 1

taocrypt_testFunction · 0.85

Calls 3

testVectorClass · 0.85
UpdateMethod · 0.45
FinalMethod · 0.45

Tested by

no test coverage detected