OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/encryptor/os_crypt.h" | 5 #include "components/os_crypt/os_crypt.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "crypto/encryptor.h" | 10 #include "crypto/encryptor.h" |
11 #include "crypto/symmetric_key.h" | 11 #include "crypto/symmetric_key.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Salt for Symmetric key derivation. | 15 // Salt for Symmetric key derivation. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 std::string iv(kIVBlockSizeAES128, ' '); | 130 std::string iv(kIVBlockSizeAES128, ' '); |
131 crypto::Encryptor encryptor; | 131 crypto::Encryptor encryptor; |
132 if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv)) | 132 if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv)) |
133 return false; | 133 return false; |
134 | 134 |
135 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) | 135 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) |
136 return false; | 136 return false; |
137 | 137 |
138 return true; | 138 return true; |
139 } | 139 } |
OLD | NEW |