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

Side by Side Diff: crypto/encryptor_openssl.cc

Issue 1312203002: Include BoringSSL headers from third_party/ in crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/hmac_openssl.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <openssl/aes.h>
8 #include <openssl/evp.h>
9
10 #include "base/logging.h" 7 #include "base/logging.h"
11 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
12 #include "crypto/openssl_util.h" 9 #include "crypto/openssl_util.h"
13 #include "crypto/symmetric_key.h" 10 #include "crypto/symmetric_key.h"
11 #include "third_party/boringssl/src/include/openssl/aes.h"
12 #include "third_party/boringssl/src/include/openssl/cipher.h"
14 13
15 namespace crypto { 14 namespace crypto {
16 15
17 namespace { 16 namespace {
18 17
19 const EVP_CIPHER* GetCipherForKey(SymmetricKey* key) { 18 const EVP_CIPHER* GetCipherForKey(SymmetricKey* key) {
20 switch (key->key().length()) { 19 switch (key->key().length()) {
21 case 16: return EVP_aes_128_cbc(); 20 case 16: return EVP_aes_128_cbc();
22 case 32: return EVP_aes_256_cbc(); 21 case 32: return EVP_aes_256_cbc();
23 default: return NULL; 22 default: return NULL;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 167
169 // AES_ctr128_encrypt() updates |ivec|. Update the |counter_| here. 168 // AES_ctr128_encrypt() updates |ivec|. Update the |counter_| here.
170 SetCounter(base::StringPiece(reinterpret_cast<const char*>(ivec), 169 SetCounter(base::StringPiece(reinterpret_cast<const char*>(ivec),
171 AES_BLOCK_SIZE)); 170 AES_BLOCK_SIZE));
172 171
173 output->swap(result); 172 output->swap(result);
174 return true; 173 return true;
175 } 174 }
176 175
177 } // namespace crypto 176 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/hmac_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698