Commit cb9d3e44 authored by Niels Möller's avatar Niels Möller

(test_cipher_ctr): Display more info on failure.

Rev: nettle/testsuite/testutils.c:1.15
parent fb4ec328
......@@ -280,7 +280,16 @@ test_cipher_ctr(const struct nettle_cipher *cipher,
length, data, cleartext);
if (!MEMEQ(length, data, ciphertext))
FAIL();
{
fprintf(stderr, "CTR encrypt failed:\nInput:");
print_hex(length, cleartext);
fprintf(stderr, "\nOutput: ");
print_hex(length, data);
fprintf(stderr, "\nExpected:");
print_hex(length, ciphertext);
fprintf(stderr, "\n");
FAIL();
}
memcpy(ctr, ictr, cipher->block_size);
......@@ -289,7 +298,16 @@ test_cipher_ctr(const struct nettle_cipher *cipher,
length, data, data);
if (!MEMEQ(length, data, cleartext))
FAIL();
{
fprintf(stderr, "CTR decrypt failed:\nInput:");
print_hex(length, ciphertext);
fprintf(stderr, "\nOutput: ");
print_hex(length, data);
fprintf(stderr, "\nExpected:");
print_hex(length, cleartext);
fprintf(stderr, "\n");
FAIL();
}
free(ctx);
free(data);
......
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