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

Side by Side Diff: crypto/hmac.h

Issue 7168004: crypto: Add critpto_api.h and annotate the current exports needed to run (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « crypto/encryptor.h ('k') | crypto/rsa_private_key.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) 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 // 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 CRYPTO_HMAC_H_ 8 #ifndef CRYPTO_HMAC_H_
9 #define CRYPTO_HMAC_H_ 9 #define CRYPTO_HMAC_H_
10 #pragma once 10 #pragma once
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/string_piece.h" 14 #include "base/string_piece.h"
15 #include "crypto/crypto_api.h"
15 16
16 namespace crypto { 17 namespace crypto {
17 18
18 // Simplify the interface and reduce includes by abstracting out the internals. 19 // Simplify the interface and reduce includes by abstracting out the internals.
19 struct HMACPlatformData; 20 struct HMACPlatformData;
20 21
21 class HMAC { 22 class CRYPTO_API HMAC {
22 public: 23 public:
23 // The set of supported hash functions. Extend as required. 24 // The set of supported hash functions. Extend as required.
24 enum HashAlgorithm { 25 enum HashAlgorithm {
25 SHA1, 26 SHA1,
26 SHA256, 27 SHA256,
27 }; 28 };
28 29
29 explicit HMAC(HashAlgorithm hash_alg); 30 explicit HMAC(HashAlgorithm hash_alg);
30 ~HMAC(); 31 ~HMAC();
31 32
(...skipping 26 matching lines...) Expand all
58 private: 59 private:
59 HashAlgorithm hash_alg_; 60 HashAlgorithm hash_alg_;
60 scoped_ptr<HMACPlatformData> plat_; 61 scoped_ptr<HMACPlatformData> plat_;
61 62
62 DISALLOW_COPY_AND_ASSIGN(HMAC); 63 DISALLOW_COPY_AND_ASSIGN(HMAC);
63 }; 64 };
64 65
65 } // namespace crypto 66 } // namespace crypto
66 67
67 #endif // CRYPTO_HMAC_H_ 68 #endif // CRYPTO_HMAC_H_
OLDNEW
« no previous file with comments | « crypto/encryptor.h ('k') | crypto/rsa_private_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698