int main() { int i, failures = 0; sha256Param param; byte digest[32]; for (i = 0; i < 2; i++) { if (sha256Reset(¶m)) return -1; if (sha256Update(¶m, table[i].input, table[i].input_size)) return -1; if (sha256Digest(¶m, digest)) return -1; if (memcmp(digest, table[i].expect, 32)) { printf("failed test vector %d\n", i+1); failures++; } } return failures; }
void sha224Update(Sha224Context *context, const void *data, size_t length) { //The function is defined in the exact same manner as SHA-256 sha256Update(context, data, length); }