OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/gcm_driver/crypto/gcm_message_cryptographer.h" | 5 #include "components/gcm_driver/crypto/gcm_message_cryptographer.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
10 #include "components/gcm_driver/crypto/p256_key_util.h" | 13 #include "components/gcm_driver/crypto/p256_key_util.h" |
11 #include "crypto/random.h" | 14 #include "crypto/random.h" |
12 #include "crypto/symmetric_key.h" | 15 #include "crypto/symmetric_key.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
14 | 17 |
15 namespace gcm { | 18 namespace gcm { |
16 | 19 |
17 namespace { | 20 namespace { |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 494 |
492 ASSERT_TRUE(cryptographer.Decrypt( | 495 ASSERT_TRUE(cryptographer.Decrypt( |
493 reference_ciphertext, receiver_shared_secret, salt, | 496 reference_ciphertext, receiver_shared_secret, salt, |
494 4096 /* record size */, &plaintext)); | 497 4096 /* record size */, &plaintext)); |
495 | 498 |
496 // Verify that the decrypted plaintext matches the reference plaintext. | 499 // Verify that the decrypted plaintext matches the reference plaintext. |
497 EXPECT_EQ(kPlaintext, plaintext); | 500 EXPECT_EQ(kPlaintext, plaintext); |
498 } | 501 } |
499 | 502 |
500 } // namespace gcm | 503 } // namespace gcm |
OLD | NEW |