| OLD | NEW |
| 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 "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "crypto/crypto_api.h" | 15 #include "crypto/crypto_export.h" |
| 16 | 16 |
| 17 #if defined(USE_NSS) | 17 #if defined(USE_NSS) |
| 18 #include "crypto/scoped_nss_types.h" | 18 #include "crypto/scoped_nss_types.h" |
| 19 #elif defined(OS_WIN) | 19 #elif defined(OS_WIN) |
| 20 #include "crypto/scoped_capi_types.h" | 20 #include "crypto/scoped_capi_types.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace crypto { | 23 namespace crypto { |
| 24 | 24 |
| 25 class SymmetricKey; | 25 class SymmetricKey; |
| 26 | 26 |
| 27 class CRYPTO_API Encryptor { | 27 class CRYPTO_EXPORT Encryptor { |
| 28 public: | 28 public: |
| 29 enum Mode { | 29 enum Mode { |
| 30 CBC, | 30 CBC, |
| 31 CTR, | 31 CTR, |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // This class implements a 128-bits counter to be used in AES-CTR encryption. | 34 // This class implements a 128-bits counter to be used in AES-CTR encryption. |
| 35 // Only 128-bits counter is supported in this class. | 35 // Only 128-bits counter is supported in this class. |
| 36 class Counter { | 36 class Counter { |
| 37 public: | 37 public: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 std::string iv_; | 128 std::string iv_; |
| 129 #elif defined(OS_WIN) | 129 #elif defined(OS_WIN) |
| 130 ScopedHCRYPTKEY capi_key_; | 130 ScopedHCRYPTKEY capi_key_; |
| 131 DWORD block_size_; | 131 DWORD block_size_; |
| 132 #endif | 132 #endif |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace crypto | 135 } // namespace crypto |
| 136 | 136 |
| 137 #endif // CRYPTO_ENCRYPTOR_H_ | 137 #endif // CRYPTO_ENCRYPTOR_H_ |
| OLD | NEW |