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

Side by Side Diff: crypto/encryptor.cc

Issue 2677583002: Fix non-noise cpplint errors in //crypto. (Closed)
Patch Set: fix p224_unittest.cc Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « crypto/ec_signature_creator_impl.h ('k') | crypto/encryptor_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "crypto/encryptor.h" 5 #include "crypto/encryptor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 14 matching lines...) Expand all
25 case 32: return EVP_aes_256_cbc(); 25 case 32: return EVP_aes_256_cbc();
26 default: 26 default:
27 return nullptr; 27 return nullptr;
28 } 28 }
29 } 29 }
30 30
31 // On destruction this class will cleanup the ctx, and also clear the OpenSSL 31 // On destruction this class will cleanup the ctx, and also clear the OpenSSL
32 // ERR stack as a convenience. 32 // ERR stack as a convenience.
33 class ScopedCipherCTX { 33 class ScopedCipherCTX {
34 public: 34 public:
35 explicit ScopedCipherCTX() { 35 ScopedCipherCTX() {
36 EVP_CIPHER_CTX_init(&ctx_); 36 EVP_CIPHER_CTX_init(&ctx_);
37 } 37 }
38 ~ScopedCipherCTX() { 38 ~ScopedCipherCTX() {
39 EVP_CIPHER_CTX_cleanup(&ctx_); 39 EVP_CIPHER_CTX_cleanup(&ctx_);
40 ClearOpenSSLERRStack(FROM_HERE); 40 ClearOpenSSLERRStack(FROM_HERE);
41 } 41 }
42 EVP_CIPHER_CTX* get() { return &ctx_; } 42 EVP_CIPHER_CTX* get() { return &ctx_; }
43 43
44 private: 44 private:
45 EVP_CIPHER_CTX ctx_; 45 EVP_CIPHER_CTX ctx_;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 // AES_ctr128_encrypt() updates |ivec|. Update the |counter_| here. 218 // AES_ctr128_encrypt() updates |ivec|. Update the |counter_| here.
219 SetCounter(base::StringPiece(reinterpret_cast<const char*>(ivec), 219 SetCounter(base::StringPiece(reinterpret_cast<const char*>(ivec),
220 AES_BLOCK_SIZE)); 220 AES_BLOCK_SIZE));
221 221
222 output->swap(result); 222 output->swap(result);
223 return true; 223 return true;
224 } 224 }
225 225
226 } // namespace crypto 226 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/ec_signature_creator_impl.h ('k') | crypto/encryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698