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 #include "crypto/encryptor.h" | 5 #include "crypto/encryptor.h" |
6 | 6 |
7 #include <cryptohi.h> | 7 #include <cryptohi.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 break; | 28 break; |
29 } | 29 } |
30 return static_cast<CK_MECHANISM_TYPE>(-1); | 30 return static_cast<CK_MECHANISM_TYPE>(-1); |
31 } | 31 } |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 Encryptor::Encryptor() | 35 Encryptor::Encryptor() |
36 : key_(NULL), | 36 : key_(NULL), |
37 mode_(CBC) { | 37 mode_(CBC) { |
| 38 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII"; |
38 EnsureNSSInit(); | 39 EnsureNSSInit(); |
39 } | 40 } |
40 | 41 |
41 Encryptor::~Encryptor() { | 42 Encryptor::~Encryptor() { |
42 } | 43 } |
43 | 44 |
44 bool Encryptor::Init(SymmetricKey* key, | 45 bool Encryptor::Init(SymmetricKey* key, |
45 Mode mode, | 46 Mode mode, |
46 const base::StringPiece& iv) { | 47 const base::StringPiece& iv) { |
47 DCHECK(key); | 48 DCHECK(key); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 // Use |output_data| to mask |input|. | 195 // Use |output_data| to mask |input|. |
195 MaskMessage( | 196 MaskMessage( |
196 reinterpret_cast<uint8*>(const_cast<char*>(input.data())), | 197 reinterpret_cast<uint8*>(const_cast<char*>(input.data())), |
197 input.length(), output_data, output_data); | 198 input.length(), output_data, output_data); |
198 output->resize(input.length()); | 199 output->resize(input.length()); |
199 return true; | 200 return true; |
200 } | 201 } |
201 | 202 |
202 } // namespace crypto | 203 } // namespace crypto |
OLD | NEW |