diff options
author | Kenny Root <kroot@google.com> | 2015-09-25 00:44:37 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-25 00:44:37 +0000 |
commit | e246de8f184e644debf965ecdca552f006b56881 (patch) | |
tree | dc62c249d595198e0d99e43890019d21e901fbec /src/crypto/modes/gcm_test.c | |
parent | c737bc23bc868fff21e5c1b95940813f709ea550 (diff) | |
parent | 00bc53f6f4436972b7a8dcf2c1e5fd0ad7515872 (diff) | |
download | external_boringssl-e246de8f184e644debf965ecdca552f006b56881.zip external_boringssl-e246de8f184e644debf965ecdca552f006b56881.tar.gz external_boringssl-e246de8f184e644debf965ecdca552f006b56881.tar.bz2 |
am 00bc53f6: am a04d78d3: Revert "external/boringssl: sync with upstream."
* commit '00bc53f6f4436972b7a8dcf2c1e5fd0ad7515872':
Revert "external/boringssl: sync with upstream."
Diffstat (limited to 'src/crypto/modes/gcm_test.c')
-rw-r--r-- | src/crypto/modes/gcm_test.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/crypto/modes/gcm_test.c b/src/crypto/modes/gcm_test.c index 89ed792..a8819ea 100644 --- a/src/crypto/modes/gcm_test.c +++ b/src/crypto/modes/gcm_test.c @@ -55,7 +55,6 @@ #include <openssl/modes.h> #include "internal.h" -#include "../test/test_util.h" struct test_case { @@ -299,6 +298,17 @@ err: return 0; } +void hexdump(const char *msg, const void *in, size_t len) { + const uint8_t *data = in; + size_t i; + + fprintf(stderr, "%s: ", msg); + for (i = 0; i < len; i++) { + fprintf(stderr, "%02x", data[i]); + } + fprintf(stderr, "\n"); +} + static int run_test_case(unsigned test_num, const struct test_case *test) { size_t key_len, plaintext_len, additional_data_len, nonce_len, ciphertext_len, tag_len; @@ -357,8 +367,8 @@ static int run_test_case(unsigned test_num, const struct test_case *test) { if (!CRYPTO_gcm128_finish(&ctx, tag, tag_len) || (ciphertext && memcmp(out, ciphertext, plaintext_len) != 0)) { fprintf(stderr, "%u: encrypt failed.\n", test_num); - hexdump(stderr, "got :", out, plaintext_len); - hexdump(stderr, "want:", ciphertext, plaintext_len); + hexdump("got ", out, plaintext_len); + hexdump("want", ciphertext, plaintext_len); goto out; } |