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

Side by Side Diff: components/webcrypto/algorithms/aes_cbc_unittest.cc

Issue 1461703009: Switch //components from vector_as_array to vector::data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman comment Created 5 years, 1 month 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 | « components/webcrypto/algorithms/aes_cbc.cc ('k') | components/webcrypto/algorithms/aes_ctr.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/stl_util.h"
6 #include "base/values.h" 5 #include "base/values.h"
7 #include "components/webcrypto/algorithm_dispatch.h" 6 #include "components/webcrypto/algorithm_dispatch.h"
8 #include "components/webcrypto/algorithms/test_helpers.h" 7 #include "components/webcrypto/algorithms/test_helpers.h"
9 #include "components/webcrypto/crypto_data.h" 8 #include "components/webcrypto/crypto_data.h"
10 #include "components/webcrypto/status.h" 9 #include "components/webcrypto/status.h"
11 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" 10 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
12 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" 11 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
13 12
14 namespace webcrypto { 13 namespace webcrypto {
15 14
16 namespace { 15 namespace {
17 16
18 // Creates an AES-CBC algorithm. 17 // Creates an AES-CBC algorithm.
19 blink::WebCryptoAlgorithm CreateAesCbcAlgorithm( 18 blink::WebCryptoAlgorithm CreateAesCbcAlgorithm(
20 const std::vector<uint8_t>& iv) { 19 const std::vector<uint8_t>& iv) {
21 return blink::WebCryptoAlgorithm::adoptParamsAndCreate( 20 return blink::WebCryptoAlgorithm::adoptParamsAndCreate(
22 blink::WebCryptoAlgorithmIdAesCbc, 21 blink::WebCryptoAlgorithmIdAesCbc,
23 new blink::WebCryptoAesCbcParams(vector_as_array(&iv), 22 new blink::WebCryptoAesCbcParams(iv.data(),
24 static_cast<unsigned int>(iv.size()))); 23 static_cast<unsigned int>(iv.size())));
25 } 24 }
26 25
27 blink::WebCryptoAlgorithm CreateAesCbcKeyGenAlgorithm( 26 blink::WebCryptoAlgorithm CreateAesCbcKeyGenAlgorithm(
28 unsigned short key_length_bits) { 27 unsigned short key_length_bits) {
29 return CreateAesKeyGenAlgorithm(blink::WebCryptoAlgorithmIdAesCbc, 28 return CreateAesKeyGenAlgorithm(blink::WebCryptoAlgorithmIdAesCbc,
30 key_length_bits); 29 key_length_bits);
31 } 30 }
32 31
33 blink::WebCryptoKey GetTestAesCbcKey() { 32 blink::WebCryptoKey GetTestAesCbcKey() {
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki); 558 EXPECT_EQ(public_key_spki, unwrapped_public_key_spki);
560 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8); 559 EXPECT_EQ(private_key_pkcs8, unwrapped_private_key_pkcs8);
561 560
562 EXPECT_NE(public_key_spki, wrapped_public_key); 561 EXPECT_NE(public_key_spki, wrapped_public_key);
563 EXPECT_NE(private_key_pkcs8, wrapped_private_key); 562 EXPECT_NE(private_key_pkcs8, wrapped_private_key);
564 } 563 }
565 564
566 } // namespace 565 } // namespace
567 566
568 } // namespace webcrypto 567 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/aes_cbc.cc ('k') | components/webcrypto/algorithms/aes_ctr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698