From: Niels Möller Date: Wed, 29 Jun 2011 13:37:11 +0000 (+0200) Subject: (test_cipher_ctr): Display more info on failure. X-Git-Tag: nettle_2.2_release_20110711~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf3390de8055fdf49127c10280b01ff444594b59;p=thirdparty%2Fnettle.git (test_cipher_ctr): Display more info on failure. Rev: nettle/testsuite/testutils.c:1.15 --- diff --git a/testsuite/testutils.c b/testsuite/testutils.c index 657b7f2c..d77bb7ef 100644 --- a/testsuite/testutils.c +++ b/testsuite/testutils.c @@ -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);