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

Unified Diff: components/webcrypto/algorithms/util.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webcrypto/algorithms/test_helpers.cc ('k') | components/webcrypto/crypto_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/util.cc
diff --git a/components/webcrypto/algorithms/util.cc b/components/webcrypto/algorithms/util.cc
index 43e728cd61d8599fd9cd7a4f4d88d7eed893988d..4a3b747acc2752365c65f156837c5af95f8b2166 100644
--- a/components/webcrypto/algorithms/util.cc
+++ b/components/webcrypto/algorithms/util.cc
@@ -9,7 +9,6 @@
#include <openssl/digest.h>
#include "base/logging.h"
-#include "base/stl_util.h"
#include "components/webcrypto/crypto_data.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
@@ -87,8 +86,8 @@ Status AeadEncryptDecrypt(EncryptOrDecrypt mode,
if (!aead_alg)
return Status::ErrorUnexpected();
- if (!EVP_AEAD_CTX_init(&ctx, aead_alg, vector_as_array(&raw_key),
- raw_key.size(), tag_length_bytes, NULL)) {
+ if (!EVP_AEAD_CTX_init(&ctx, aead_alg, raw_key.data(), raw_key.size(),
+ tag_length_bytes, NULL)) {
return Status::OperationError();
}
@@ -103,7 +102,7 @@ Status AeadEncryptDecrypt(EncryptOrDecrypt mode,
buffer->resize(data.byte_length() - tag_length_bytes);
- ok = EVP_AEAD_CTX_open(&ctx, vector_as_array(buffer), &len, buffer->size(),
+ ok = EVP_AEAD_CTX_open(&ctx, buffer->data(), &len, buffer->size(),
iv.bytes(), iv.byte_length(), data.bytes(),
data.byte_length(), additional_data.bytes(),
additional_data.byte_length());
@@ -112,7 +111,7 @@ Status AeadEncryptDecrypt(EncryptOrDecrypt mode,
// the output buffer is too small).
buffer->resize(data.byte_length() + EVP_AEAD_max_overhead(aead_alg));
- ok = EVP_AEAD_CTX_seal(&ctx, vector_as_array(buffer), &len, buffer->size(),
+ ok = EVP_AEAD_CTX_seal(&ctx, buffer->data(), &len, buffer->size(),
iv.bytes(), iv.byte_length(), data.bytes(),
data.byte_length(), additional_data.bytes(),
additional_data.byte_length());
« no previous file with comments | « components/webcrypto/algorithms/test_helpers.cc ('k') | components/webcrypto/crypto_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698