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

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

parent c9f986d2
2012-10-03 Niels Möller <>
From: Nikos Mavrogiannopoulos:
* testsuite/testutils.c (test_hash): On failure, print the
expected and returned hash values.
2012-09-23 Niels Möller <> 2012-09-23 Niels Möller <>
* (nettle_SOURCES): Added salsa20-core-internal.c. * (nettle_SOURCES): Added salsa20-core-internal.c.
...@@ -498,7 +498,14 @@ test_hash(const struct nettle_hash *hash, ...@@ -498,7 +498,14 @@ test_hash(const struct nettle_hash *hash,
hash->update(ctx, msg->length, msg->data); hash->update(ctx, msg->length, msg->data);
hash->digest(ctx, hash->digest_size, buffer); 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);
memset(buffer, 0, hash->digest_size); memset(buffer, 0, hash->digest_size);
Supports Markdown
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