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

Side by Side Diff: crypto/encryptor.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/crypto_api.h ('k') | crypto/hmac.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_ENCRYPTOR_H_ 5 #ifndef CRYPTO_ENCRYPTOR_H_
6 #define CRYPTO_ENCRYPTOR_H_ 6 #define CRYPTO_ENCRYPTOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "crypto/crypto_api.h"
12 13
13 #if defined(USE_NSS) 14 #if defined(USE_NSS)
14 #include "crypto/scoped_nss_types.h" 15 #include "crypto/scoped_nss_types.h"
15 #elif defined(OS_WIN) 16 #elif defined(OS_WIN)
16 #include "crypto/scoped_capi_types.h" 17 #include "crypto/scoped_capi_types.h"
17 #endif 18 #endif
18 19
19 namespace crypto { 20 namespace crypto {
20 21
21 class SymmetricKey; 22 class SymmetricKey;
22 23
23 class Encryptor { 24 class CRYPTO_API Encryptor {
24 public: 25 public:
25 enum Mode { 26 enum Mode {
26 CBC 27 CBC
27 }; 28 };
28 Encryptor(); 29 Encryptor();
29 virtual ~Encryptor(); 30 virtual ~Encryptor();
30 31
31 // Initializes the encryptor using |key| and |iv|. Returns false if either the 32 // Initializes the encryptor using |key| and |iv|. Returns false if either the
32 // key or the initialization vector cannot be used. 33 // key or the initialization vector cannot be used.
33 bool Init(SymmetricKey* key, Mode mode, const std::string& iv); 34 bool Init(SymmetricKey* key, Mode mode, const std::string& iv);
(...skipping 26 matching lines...) Expand all
60 std::string iv_; 61 std::string iv_;
61 #elif defined(OS_WIN) 62 #elif defined(OS_WIN)
62 ScopedHCRYPTKEY capi_key_; 63 ScopedHCRYPTKEY capi_key_;
63 DWORD block_size_; 64 DWORD block_size_;
64 #endif 65 #endif
65 }; 66 };
66 67
67 } // namespace crypto 68 } // namespace crypto
68 69
69 #endif // CRYPTO_ENCRYPTOR_H_ 70 #endif // CRYPTO_ENCRYPTOR_H_
OLDNEW
« no previous file with comments | « crypto/crypto_api.h ('k') | crypto/hmac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698