summaryrefslogtreecommitdiffstats
path: root/src/crypto/modes/gcm_test.c
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-10-02 16:09:15 -0700
committerKenny Root <kroot@google.com>2015-10-02 16:09:49 -0700
commitfe7305364c3369f9222a61646c5c9842eae9bceb (patch)
tree360ada970b7bb1046ae069d253ba24d9622eb3ad /src/crypto/modes/gcm_test.c
parent691ef9d0ff0ece39ffd6a58960a7cd195ef584ae (diff)
parentb452bce3bf2034466cee6206ebf3994409468ee4 (diff)
downloadexternal_boringssl-fe7305364c3369f9222a61646c5c9842eae9bceb.zip
external_boringssl-fe7305364c3369f9222a61646c5c9842eae9bceb.tar.gz
external_boringssl-fe7305364c3369f9222a61646c5c9842eae9bceb.tar.bz2
Merge mnc-dr-dev-plus-aosp into mnc-ub-dev
This pulls in the latest version of BoringSSL. Change-Id: I0ab5c73d60f41a696c9a828fac87670aaca10dec
Diffstat (limited to 'src/crypto/modes/gcm_test.c')
-rw-r--r--src/crypto/modes/gcm_test.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/crypto/modes/gcm_test.c b/src/crypto/modes/gcm_test.c
index a8819ea..89ed792 100644
--- a/src/crypto/modes/gcm_test.c
+++ b/src/crypto/modes/gcm_test.c
@@ -55,6 +55,7 @@
#include <openssl/modes.h>
#include "internal.h"
+#include "../test/test_util.h"
struct test_case {
@@ -298,17 +299,6 @@ 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;
@@ -367,8 +357,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("got ", out, plaintext_len);
- hexdump("want", ciphertext, plaintext_len);
+ hexdump(stderr, "got :", out, plaintext_len);
+ hexdump(stderr, "want:", ciphertext, plaintext_len);
goto out;
}