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

Side by Side Diff: base/hmac.h

Issue 6729002: Base: A few more files using BASE_API (for base.dll) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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/environment.h ('k') | base/json/json_reader.h » ('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) 2006-2008 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 // Utility class for calculating the HMAC for a given message. We currently 5 // Utility class for calculating the HMAC for a given message. We currently
6 // only support SHA1 for the hash algorithm, but this can be extended easily. 6 // only support SHA1 for the hash algorithm, but this can be extended easily.
7 7
8 #ifndef BASE_HMAC_H_ 8 #ifndef BASE_HMAC_H_
9 #define BASE_HMAC_H_ 9 #define BASE_HMAC_H_
10 #pragma once 10 #pragma once
11 11
12 #include <string> 12 #include <string>
13 13
14 #include "base/base_api.h"
14 #include "base/basictypes.h" 15 #include "base/basictypes.h"
15 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
16 17
17 namespace base { 18 namespace base {
18 19
19 // Simplify the interface and reduce includes by abstracting out the internals. 20 // Simplify the interface and reduce includes by abstracting out the internals.
20 struct HMACPlatformData; 21 struct HMACPlatformData;
21 22
22 class HMAC { 23 class BASE_API HMAC {
23 public: 24 public:
24 // The set of supported hash functions. Extend as required. 25 // The set of supported hash functions. Extend as required.
25 enum HashAlgorithm { 26 enum HashAlgorithm {
26 SHA1, 27 SHA1,
27 SHA256, 28 SHA256,
28 }; 29 };
29 30
30 explicit HMAC(HashAlgorithm hash_alg); 31 explicit HMAC(HashAlgorithm hash_alg);
31 ~HMAC(); 32 ~HMAC();
32 33
(...skipping 18 matching lines...) Expand all
51 private: 52 private:
52 HashAlgorithm hash_alg_; 53 HashAlgorithm hash_alg_;
53 scoped_ptr<HMACPlatformData> plat_; 54 scoped_ptr<HMACPlatformData> plat_;
54 55
55 DISALLOW_COPY_AND_ASSIGN(HMAC); 56 DISALLOW_COPY_AND_ASSIGN(HMAC);
56 }; 57 };
57 58
58 } // namespace base 59 } // namespace base
59 60
60 #endif // BASE_HMAC_H_ 61 #endif // BASE_HMAC_H_
OLDNEW
« no previous file with comments | « base/environment.h ('k') | base/json/json_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698