Esempio n. 1
0
int main()
{
	int i, failures = 0;
	sha256Param param;
	byte digest[32];

	for (i = 0; i < 2; i++)
	{
		if (sha256Reset(&param))
			return -1;
		if (sha256Update(&param, table[i].input, table[i].input_size))
			return -1;
		if (sha256Digest(&param, digest))
			return -1;

		if (memcmp(digest, table[i].expect, 32))
		{
			printf("failed test vector %d\n", i+1);
			failures++;
		}
	}
	return failures;
}
Esempio n. 2
0
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);
}