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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: net/quic/crypto/crypto_secret_boxer.cc
diff --git a/net/quic/crypto/crypto_secret_boxer.cc b/net/quic/crypto/crypto_secret_boxer.cc
index 5d8a11b27a309c9a612d8194732af76ef1e1a39a..2675441d26f1afb31c2abed656427ac548774bb1 100644
--- a/net/quic/crypto/crypto_secret_boxer.cc
+++ b/net/quic/crypto/crypto_secret_boxer.cc
@@ -33,7 +33,9 @@ static const size_t kKeySize = 16;
static const size_t kBoxNonceSize = 12;
// static
-size_t CryptoSecretBoxer::GetKeySize() { return kKeySize; }
+size_t CryptoSecretBoxer::GetKeySize() {
+ return kKeySize;
+}
void CryptoSecretBoxer::SetKey(StringPiece key) {
DCHECK_EQ(kKeySize, key.size());
@@ -57,9 +59,11 @@ string CryptoSecretBoxer::Box(QuicRandom* rand, StringPiece plaintext) const {
rand->RandBytes(data, kBoxNonceSize);
memcpy(data + kBoxNonceSize, plaintext.data(), plaintext.size());
- if (!encrypter->Encrypt(StringPiece(data, kBoxNonceSize), StringPiece(),
- plaintext, reinterpret_cast<unsigned char*>(
- data + kBoxNonceSize))) {
+ if (!encrypter->Encrypt(
+ StringPiece(data, kBoxNonceSize),
+ StringPiece(),
+ plaintext,
+ reinterpret_cast<unsigned char*>(data + kBoxNonceSize))) {
DLOG(DFATAL) << "CryptoSecretBoxer's Encrypt failed.";
return string();
}
@@ -87,8 +91,10 @@ bool CryptoSecretBoxer::Unbox(StringPiece ciphertext,
DLOG(DFATAL) << "CryptoSecretBoxer's decrypter->SetKey failed.";
return false;
}
- if (!decrypter->Decrypt(StringPiece(nonce, kBoxNonceSize), StringPiece(),
- ciphertext, reinterpret_cast<unsigned char*>(data),
+ if (!decrypter->Decrypt(StringPiece(nonce, kBoxNonceSize),
+ StringPiece(),
+ ciphertext,
+ reinterpret_cast<unsigned char*>(data),
&len)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698