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

Side by Side Diff: base/hmac_mac.cc

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « base/global_descriptors_posix.cc ('k') | base/json/json_reader.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 <CommonCrypto/CommonDigest.h>
6 #include <CommonCrypto/CommonHMAC.h>
7 #include <string>
8
5 #include "base/hmac.h" 9 #include "base/hmac.h"
6
7 #include <CommonCrypto/CommonHMAC.h>
8
9 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/scoped_ptr.h"
10 12
11 namespace base { 13 namespace base {
12 14
13 struct HMACPlatformData { 15 struct HMACPlatformData {
14 std::string key_; 16 std::string key_;
15 }; 17 };
16 18
17 HMAC::HMAC(HashAlgorithm hash_alg) 19 HMAC::HMAC(HashAlgorithm hash_alg)
18 : hash_alg_(hash_alg), plat_(new HMACPlatformData()) { 20 : hash_alg_(hash_alg), plat_(new HMACPlatformData()) {
19 // Only SHA-1 and SHA-256 hash algorithms are supported now. 21 // Only SHA-1 and SHA-256 hash algorithms are supported now.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 66 }
65 67
66 CCHmac(algorithm, 68 CCHmac(algorithm,
67 plat_->key_.data(), plat_->key_.length(), data.data(), data.length(), 69 plat_->key_.data(), plat_->key_.length(), data.data(), data.length(),
68 digest); 70 digest);
69 71
70 return true; 72 return true;
71 } 73 }
72 74
73 } // namespace base 75 } // namespace base
OLDNEW
« no previous file with comments | « base/global_descriptors_posix.cc ('k') | base/json/json_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698