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

Unified Diff: components/webcrypto/algorithms/aes_ctr.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
Index: components/webcrypto/algorithms/aes_ctr.cc
diff --git a/components/webcrypto/algorithms/aes_ctr.cc b/components/webcrypto/algorithms/aes_ctr.cc
index f4c16b63d75ade23b892193acab00b86308b0a83..39ca0871db3511402f8365a6404996924df7c97b 100644
--- a/components/webcrypto/algorithms/aes_ctr.cc
+++ b/components/webcrypto/algorithms/aes_ctr.cc
@@ -8,7 +8,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/numerics/safe_math.h"
-#include "base/stl_util.h"
#include "components/webcrypto/algorithms/aes.h"
#include "components/webcrypto/algorithms/util.h"
#include "components/webcrypto/blink_key_handle.h"
@@ -104,8 +103,7 @@ crypto::ScopedBIGNUM GetCounter(const CryptoData& counter_block,
counter_block.bytes() + counter_block.byte_length());
counter[0] &= ~(0xFF << counter_length_remainder_bits);
- return crypto::ScopedBIGNUM(
- BN_bin2bn(vector_as_array(&counter), counter.size(), NULL));
+ return crypto::ScopedBIGNUM(BN_bin2bn(counter.data(), counter.size(), NULL));
}
// Returns a counter block with the counter bits all set all zero.
@@ -206,7 +204,7 @@ Status AesCtrEncryptDecrypt(const blink::WebCryptoAlgorithm& algorithm,
// wrapping-around, do it as a single call into BoringSSL.
if (BN_cmp(num_blocks_until_reset.get(), num_output_blocks.get()) >= 0) {
return AesCtrEncrypt128BitCounter(cipher, CryptoData(raw_key), data,
- counter_block, vector_as_array(buffer));
+ counter_block, buffer->data());
}
// Otherwise the encryption needs to be done in 2 parts. The first part using
@@ -222,7 +220,7 @@ Status AesCtrEncryptDecrypt(const blink::WebCryptoAlgorithm& algorithm,
// Encrypt the first part (before wrap-around).
Status status = AesCtrEncrypt128BitCounter(
cipher, CryptoData(raw_key), CryptoData(data.bytes(), input_size_part1),
- counter_block, vector_as_array(buffer));
+ counter_block, buffer->data());
if (status.IsError())
return status;
@@ -234,8 +232,7 @@ Status AesCtrEncryptDecrypt(const blink::WebCryptoAlgorithm& algorithm,
cipher, CryptoData(raw_key),
CryptoData(data.bytes() + input_size_part1,
data.byte_length() - input_size_part1),
- CryptoData(counter_block_part2),
- vector_as_array(buffer) + input_size_part1);
+ CryptoData(counter_block_part2), buffer->data() + input_size_part1);
}
class AesCtrImplementation : public AesAlgorithm {
« no previous file with comments | « components/webcrypto/algorithms/aes_cbc_unittest.cc ('k') | components/webcrypto/algorithms/aes_ctr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698