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

Unified Diff: net/quic/crypto/aes_128_gcm_encrypter_openssl.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/aes_128_gcm_decrypter_test.cc ('k') | net/quic/crypto/aes_128_gcm_encrypter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aes_128_gcm_encrypter_openssl.cc
diff --git a/net/quic/crypto/aes_128_gcm_encrypter_openssl.cc b/net/quic/crypto/aes_128_gcm_encrypter_openssl.cc
index daa85f0470eaaea1fd12804c2c6fe2be26f3870d..b00dec8fcafc438f65bce737125c32ee33a02bb9 100644
--- a/net/quic/crypto/aes_128_gcm_encrypter_openssl.cc
+++ b/net/quic/crypto/aes_128_gcm_encrypter_openssl.cc
@@ -26,9 +26,7 @@ Aes128GcmEncrypter::Aes128GcmEncrypter() {
}
// static
-bool Aes128GcmEncrypter::IsSupported() {
- return true;
-}
+bool Aes128GcmEncrypter::IsSupported() { return true; }
bool Aes128GcmEncrypter::SetKey(StringPiece key) {
DCHECK_EQ(key.size(), sizeof(key_));
@@ -63,8 +61,7 @@ bool Aes128GcmEncrypter::Encrypt(StringPiece nonce,
ScopedEVPCipherCtx ctx;
// Set the cipher type and the key. The IV (nonce) is set below.
- if (EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_gcm(), NULL, key_,
- NULL) == 0) {
+ if (EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_gcm(), NULL, key_, NULL) == 0) {
return false;
}
@@ -74,9 +71,9 @@ bool Aes128GcmEncrypter::Encrypt(StringPiece nonce,
return false;
}
// Set the IV (nonce).
- if (EVP_EncryptInit_ex(ctx.get(), NULL, NULL, NULL,
- reinterpret_cast<const unsigned char*>(
- nonce.data())) == 0) {
+ if (EVP_EncryptInit_ex(
+ ctx.get(), NULL, NULL, NULL,
+ reinterpret_cast<const unsigned char*>(nonce.data())) == 0) {
return false;
}
@@ -85,18 +82,18 @@ bool Aes128GcmEncrypter::Encrypt(StringPiece nonce,
if (!associated_data.empty()) {
// Set the associated data. The second argument (output buffer) must be
// NULL.
- if (EVP_EncryptUpdate(ctx.get(), NULL, &output_len,
- reinterpret_cast<const unsigned char*>(
- associated_data.data()),
- associated_data.size()) == 0) {
+ if (EVP_EncryptUpdate(
+ ctx.get(), NULL, &output_len,
+ reinterpret_cast<const unsigned char*>(associated_data.data()),
+ associated_data.size()) == 0) {
return false;
}
}
- if (EVP_EncryptUpdate(ctx.get(), output, &output_len,
- reinterpret_cast<const unsigned char*>(
- plaintext.data()),
- plaintext.size()) == 0) {
+ if (EVP_EncryptUpdate(
+ ctx.get(), output, &output_len,
+ reinterpret_cast<const unsigned char*>(plaintext.data()),
+ plaintext.size()) == 0) {
return false;
}
output += output_len;
@@ -134,9 +131,7 @@ QuicData* Aes128GcmEncrypter::EncryptPacket(
return new QuicData(ciphertext.release(), ciphertext_size, true);
}
-size_t Aes128GcmEncrypter::GetKeySize() const {
- return kKeySize;
-}
+size_t Aes128GcmEncrypter::GetKeySize() const { return kKeySize; }
size_t Aes128GcmEncrypter::GetNoncePrefixSize() const {
return kNoncePrefixSize;
« no previous file with comments | « net/quic/crypto/aes_128_gcm_decrypter_test.cc ('k') | net/quic/crypto/aes_128_gcm_encrypter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698