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

Side by Side Diff: crypto/encryptor.h

Issue 1909513003: Rename crypto/ *_openssl files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « crypto/ec_private_key_openssl.cc ('k') | crypto/encryptor.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 size_t GetLengthInBytes() const; 44 size_t GetLengthInBytes() const;
45 45
46 private: 46 private:
47 union { 47 union {
48 uint32_t components32[4]; 48 uint32_t components32[4];
49 uint64_t components64[2]; 49 uint64_t components64[2];
50 } counter_; 50 } counter_;
51 }; 51 };
52 52
53 Encryptor(); 53 Encryptor();
54 virtual ~Encryptor(); 54 ~Encryptor();
55 55
56 // Initializes the encryptor using |key| and |iv|. Returns false if either the 56 // Initializes the encryptor using |key| and |iv|. Returns false if either the
57 // key or the initialization vector cannot be used. 57 // key or the initialization vector cannot be used.
58 // 58 //
59 // If |mode| is CBC, |iv| must not be empty; if it is CTR, then |iv| must be 59 // If |mode| is CBC, |iv| must not be empty; if it is CTR, then |iv| must be
60 // empty. 60 // empty.
61 bool Init(SymmetricKey* key, Mode mode, const base::StringPiece& iv); 61 bool Init(SymmetricKey* key, Mode mode, const base::StringPiece& iv);
62 62
63 // Encrypts |plaintext| into |ciphertext|. |plaintext| may only be empty if 63 // Encrypts |plaintext| into |ciphertext|. |plaintext| may only be empty if
64 // the mode is CBC. 64 // the mode is CBC.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::string* output); 116 std::string* output);
117 bool CryptCTR(bool do_encrypt, 117 bool CryptCTR(bool do_encrypt,
118 const base::StringPiece& input, 118 const base::StringPiece& input,
119 std::string* output); 119 std::string* output);
120 std::string iv_; 120 std::string iv_;
121 }; 121 };
122 122
123 } // namespace crypto 123 } // namespace crypto
124 124
125 #endif // CRYPTO_ENCRYPTOR_H_ 125 #endif // CRYPTO_ENCRYPTOR_H_
OLDNEW
« no previous file with comments | « crypto/ec_private_key_openssl.cc ('k') | crypto/encryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698