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

Side by Side Diff: base/crypto/encryptor.h

Issue 4777001: Implements encryptor_openssl.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux & win Created 10 years, 1 month 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 | « no previous file | base/crypto/encryptor_nss.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 #ifndef BASE_CRYPTO_ENCRYPTOR_H_ 5 #ifndef BASE_CRYPTO_ENCRYPTOR_H_
6 #define BASE_CRYPTO_ENCRYPTOR_H_ 6 #define BASE_CRYPTO_ENCRYPTOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 37
38 // Decrypts |ciphertext| into |plaintext|. 38 // Decrypts |ciphertext| into |plaintext|.
39 bool Decrypt(const std::string& ciphertext, std::string* plaintext); 39 bool Decrypt(const std::string& ciphertext, std::string* plaintext);
40 40
41 // TODO(albertb): Support streaming encryption. 41 // TODO(albertb): Support streaming encryption.
42 42
43 private: 43 private:
44 SymmetricKey* key_; 44 SymmetricKey* key_;
45 Mode mode_; 45 Mode mode_;
46 46
47 #if defined(USE_NSS) 47 #if defined(USE_OPENSSL)
48 bool Crypt(bool encrypt, // Pass true to encrypt, false to decrypt.
49 const std::string& input,
50 std::string* output);
51 std::string iv_;
52 #elif defined(USE_NSS)
48 ScopedPK11Slot slot_; 53 ScopedPK11Slot slot_;
49 ScopedSECItem param_; 54 ScopedSECItem param_;
50 #elif defined(OS_MACOSX) 55 #elif defined(OS_MACOSX)
51 bool Crypt(int /*CCOperation*/ op, 56 bool Crypt(int /*CCOperation*/ op,
52 const std::string& input, 57 const std::string& input,
53 std::string* output); 58 std::string* output);
54 59
55 std::string iv_; 60 std::string iv_;
56 #elif defined(OS_WIN) 61 #elif defined(OS_WIN)
57 ScopedHCRYPTKEY capi_key_; 62 ScopedHCRYPTKEY capi_key_;
58 DWORD block_size_; 63 DWORD block_size_;
59 #endif 64 #endif
60 }; 65 };
61 66
62 } // namespace base 67 } // namespace base
63 68
64 #endif // BASE_CRYPTO_ENCRYPTOR_H_ 69 #endif // BASE_CRYPTO_ENCRYPTOR_H_
OLDNEW
« no previous file with comments | « no previous file | base/crypto/encryptor_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698