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

Side by Side Diff: base/crypto/symmetric_key_mac.cc

Issue 3071012: Cleanup: Remove unneeded headers from base/ (part 1) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « app/win_util.cc ('k') | base/file_path.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/crypto/symmetric_key.h" 5 #include "base/crypto/symmetric_key.h"
6 6
7 #include <CommonCrypto/CommonCryptor.h> 7 #include <CommonCrypto/CommonCryptor.h>
8 #include <CoreFoundation/CFString.h> 8 #include <CoreFoundation/CFString.h>
9 #include <Security/cssm.h> 9 #include <Security/cssm.h>
10 10
11 #include "base/crypto/cssm_init.h" 11 #include "base/crypto/cssm_init.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/rand_util.h"
14 13
15 namespace { 14 namespace {
16 15
17 CSSM_KEY_TYPE CheckKeyParams(base::SymmetricKey::Algorithm algorithm, 16 CSSM_KEY_TYPE CheckKeyParams(base::SymmetricKey::Algorithm algorithm,
18 size_t key_size_in_bits) { 17 size_t key_size_in_bits) {
19 if (algorithm == base::SymmetricKey::AES) { 18 if (algorithm == base::SymmetricKey::AES) {
20 CHECK(key_size_in_bits == 128 || 19 CHECK(key_size_in_bits == 128 ||
21 key_size_in_bits == 192 || 20 key_size_in_bits == 192 ||
22 key_size_in_bits == 256) 21 key_size_in_bits == 256)
23 << "Invalid key size " << key_size_in_bits << " bits"; 22 << "Invalid key size " << key_size_in_bits << " bits";
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 bool SymmetricKey::GetRawKey(std::string* raw_key) { 146 bool SymmetricKey::GetRawKey(std::string* raw_key) {
148 *raw_key = key_; 147 *raw_key = key_;
149 return true; 148 return true;
150 } 149 }
151 150
152 CSSM_DATA SymmetricKey::cssm_data() const { 151 CSSM_DATA SymmetricKey::cssm_data() const {
153 return StringToData(key_); 152 return StringToData(key_);
154 } 153 }
155 154
156 } // namespace base 155 } // namespace base
OLDNEW
« no previous file with comments | « app/win_util.cc ('k') | base/file_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698