Commit 922a8b67 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos Committed by Niels Möller

(test_hash): On failure, print the expected and returned hash values.

parent c9f986d2
2012-10-03 Niels Möller <nisse@lysator.liu.se>
From: Nikos Mavrogiannopoulos:
* testsuite/testutils.c (test_hash): On failure, print the
expected and returned hash values.
2012-09-23 Niels Möller <nisse@lysator.liu.se>
* Makefile.in (nettle_SOURCES): Added salsa20-core-internal.c.
......
......@@ -498,7 +498,14 @@ test_hash(const struct nettle_hash *hash,
hash->update(ctx, msg->length, msg->data);
hash->digest(ctx, hash->digest_size, buffer);
ASSERT(MEMEQ(hash->digest_size, digest->data, buffer));
if (MEMEQ(hash->digest_size, digest->data, buffer) == 0)
{
fprintf(stdout, "\nGot:\n");
print_hex(hash->digest_size, buffer);
fprintf(stdout, "\nExpected:\n");
print_hex(hash->digest_size, digest->data);
abort();
}
memset(buffer, 0, hash->digest_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment