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

Side by Side Diff: crypto/aead_unittest.cc

Issue 1909513003: Rename crypto/ *_openssl files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « crypto/aead_openssl_unittest.cc ('k') | crypto/crypto.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "crypto/aead_openssl.h" 5 #include "crypto/aead.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 12
13 TEST(AeadTest, SealOpen) { 13 TEST(AeadTest, SealOpen) {
14 crypto::Aead aead(crypto::Aead::AES_128_CTR_HMAC_SHA256); 14 crypto::Aead aead(crypto::Aead::AES_128_CTR_HMAC_SHA256);
15 std::string key(aead.KeyLength(), 0); 15 std::string key(aead.KeyLength(), 0);
(...skipping 25 matching lines...) Expand all
41 std::string ciphertext; 41 std::string ciphertext;
42 EXPECT_TRUE(aead.Seal(plaintext, nonce, ad, &ciphertext)); 42 EXPECT_TRUE(aead.Seal(plaintext, nonce, ad, &ciphertext));
43 EXPECT_LT(0U, ciphertext.size()); 43 EXPECT_LT(0U, ciphertext.size());
44 44
45 std::string decrypted; 45 std::string decrypted;
46 EXPECT_FALSE(aead_wrong_key.Open(ciphertext, nonce, ad, &decrypted)); 46 EXPECT_FALSE(aead_wrong_key.Open(ciphertext, nonce, ad, &decrypted));
47 EXPECT_EQ(0U, decrypted.size()); 47 EXPECT_EQ(0U, decrypted.size());
48 } 48 }
49 49
50 } // namespace 50 } // namespace
OLDNEW
« no previous file with comments | « crypto/aead_openssl_unittest.cc ('k') | crypto/crypto.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698