Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1859)

Unified Diff: net/quic/crypto/aes_128_gcm_encrypter_test.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/aes_128_gcm_encrypter_openssl.cc ('k') | net/quic/crypto/cert_compressor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aes_128_gcm_encrypter_test.cc
diff --git a/net/quic/crypto/aes_128_gcm_encrypter_test.cc b/net/quic/crypto/aes_128_gcm_encrypter_test.cc
index 0da7a8f4890b6d4ec5076b92fa4399acbfeed3a3..7e07ba9d55763ed5cb3bc433e3ec87108e2fe45d 100644
--- a/net/quic/crypto/aes_128_gcm_encrypter_test.cc
+++ b/net/quic/crypto/aes_128_gcm_encrypter_test.cc
@@ -285,18 +285,15 @@ TEST(Aes128GcmEncrypterTest, Encrypt) {
const TestGroupInfo& test_info = test_group_info[i];
for (size_t j = 0; test_vector[j].key != NULL; j++) {
// Decode the test vector.
- ASSERT_TRUE(DecodeHexString(test_vector[j].key, key, &key_len,
- sizeof(key)));
- ASSERT_TRUE(DecodeHexString(test_vector[j].iv, iv, &iv_len,
- sizeof(iv)));
- ASSERT_TRUE(DecodeHexString(test_vector[j].pt, pt, &pt_len,
- sizeof(pt)));
- ASSERT_TRUE(DecodeHexString(test_vector[j].aad, aad, &aad_len,
- sizeof(aad)));
- ASSERT_TRUE(DecodeHexString(test_vector[j].ct, ct, &ct_len,
- sizeof(ct)));
- ASSERT_TRUE(DecodeHexString(test_vector[j].tag, tag, &tag_len,
- sizeof(tag)));
+ ASSERT_TRUE(
+ DecodeHexString(test_vector[j].key, key, &key_len, sizeof(key)));
+ ASSERT_TRUE(DecodeHexString(test_vector[j].iv, iv, &iv_len, sizeof(iv)));
+ ASSERT_TRUE(DecodeHexString(test_vector[j].pt, pt, &pt_len, sizeof(pt)));
+ ASSERT_TRUE(
+ DecodeHexString(test_vector[j].aad, aad, &aad_len, sizeof(aad)));
+ ASSERT_TRUE(DecodeHexString(test_vector[j].ct, ct, &ct_len, sizeof(ct)));
+ ASSERT_TRUE(
+ DecodeHexString(test_vector[j].tag, tag, &tag_len, sizeof(tag)));
// The test vector's lengths should look sane. Note that the lengths
// in |test_info| are in bits.
@@ -314,16 +311,14 @@ TEST(Aes128GcmEncrypterTest, Encrypt) {
// OpenSSL fails if NULL is set as the AAD, as opposed to a
// zero-length, non-NULL pointer. This deliberately tests that we
// handle this case.
- StringPiece(aad_len ? aad : NULL, aad_len),
- StringPiece(pt, pt_len)));
+ StringPiece(aad_len ? aad : NULL, aad_len), StringPiece(pt, pt_len)));
ASSERT_TRUE(encrypted.get());
ASSERT_EQ(ct_len + tag_len, encrypted->length());
+ test::CompareCharArraysWithHexError("ciphertext", encrypted->data(),
+ ct_len, ct, ct_len);
test::CompareCharArraysWithHexError(
- "ciphertext", encrypted->data(), ct_len,
- ct, ct_len);
- test::CompareCharArraysWithHexError(
- "authentication tag", encrypted->data() + ct_len, tag_len,
- tag, tag_len);
+ "authentication tag", encrypted->data() + ct_len, tag_len, tag,
+ tag_len);
}
}
}
« no previous file with comments | « net/quic/crypto/aes_128_gcm_encrypter_openssl.cc ('k') | net/quic/crypto/cert_compressor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698