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

Side by Side Diff: crypto/secure_hash.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/rsa_private_key.h ('k') | crypto/sha2.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 #ifndef CRYPTO_SECURE_HASH_H_ 5 #ifndef CRYPTO_SECURE_HASH_H_
6 #define CRYPTO_SECURE_HASH_H_ 6 #define CRYPTO_SECURE_HASH_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "crypto/crypto_api.h"
10 11
11 namespace crypto { 12 namespace crypto {
12 13
13 // A wrapper to calculate secure hashes incrementally, allowing to 14 // A wrapper to calculate secure hashes incrementally, allowing to
14 // be used when the full input is not known in advance. 15 // be used when the full input is not known in advance.
15 class SecureHash { 16 class CRYPTO_API SecureHash {
16 public: 17 public:
17 enum Algorithm { 18 enum Algorithm {
18 SHA256, 19 SHA256,
19 }; 20 };
20 virtual ~SecureHash() {} 21 virtual ~SecureHash() {}
21 22
22 static SecureHash* Create(Algorithm type); 23 static SecureHash* Create(Algorithm type);
23 24
24 virtual void Update(const void* input, size_t len) = 0; 25 virtual void Update(const void* input, size_t len) = 0;
25 virtual void Finish(void* output, size_t len) = 0; 26 virtual void Finish(void* output, size_t len) = 0;
26 27
27 protected: 28 protected:
28 SecureHash() {} 29 SecureHash() {}
29 30
30 private: 31 private:
31 DISALLOW_COPY_AND_ASSIGN(SecureHash); 32 DISALLOW_COPY_AND_ASSIGN(SecureHash);
32 }; 33 };
33 34
34 } // namespace crypto 35 } // namespace crypto
35 36
36 #endif // CRYPTO_SECURE_HASH_H_ 37 #endif // CRYPTO_SECURE_HASH_H_
OLDNEW
« no previous file with comments | « crypto/rsa_private_key.h ('k') | crypto/sha2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698