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 <openssl/aes.h> | |
6 #include <openssl/cipher.h> | |
7 #include <stddef.h> | 5 #include <stddef.h> |
8 #include <stdint.h> | 6 #include <stdint.h> |
9 | 7 |
10 #include "base/logging.h" | 8 #include "base/logging.h" |
11 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
12 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
13 #include "components/webcrypto/algorithms/aes.h" | 11 #include "components/webcrypto/algorithms/aes.h" |
14 #include "components/webcrypto/algorithms/util.h" | 12 #include "components/webcrypto/algorithms/util.h" |
15 #include "components/webcrypto/blink_key_handle.h" | 13 #include "components/webcrypto/blink_key_handle.h" |
16 #include "components/webcrypto/crypto_data.h" | 14 #include "components/webcrypto/crypto_data.h" |
17 #include "components/webcrypto/status.h" | 15 #include "components/webcrypto/status.h" |
18 #include "crypto/openssl_util.h" | 16 #include "crypto/openssl_util.h" |
19 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 17 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 18 #include "third_party/boringssl/src/include/openssl/aes.h" |
| 19 #include "third_party/boringssl/src/include/openssl/cipher.h" |
20 | 20 |
21 namespace webcrypto { | 21 namespace webcrypto { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const EVP_CIPHER* GetAESCipherByKeyLength(size_t key_length_bytes) { | 25 const EVP_CIPHER* GetAESCipherByKeyLength(size_t key_length_bytes) { |
26 // 192-bit AES is intentionally unsupported (http://crbug.com/533699). | 26 // 192-bit AES is intentionally unsupported (http://crbug.com/533699). |
27 switch (key_length_bytes) { | 27 switch (key_length_bytes) { |
28 case 16: | 28 case 16: |
29 return EVP_aes_128_cbc(); | 29 return EVP_aes_128_cbc(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 }; | 113 }; |
114 | 114 |
115 } // namespace | 115 } // namespace |
116 | 116 |
117 std::unique_ptr<AlgorithmImplementation> CreateAesCbcImplementation() { | 117 std::unique_ptr<AlgorithmImplementation> CreateAesCbcImplementation() { |
118 return base::WrapUnique(new AesCbcImplementation); | 118 return base::WrapUnique(new AesCbcImplementation); |
119 } | 119 } |
120 | 120 |
121 } // namespace webcrypto | 121 } // namespace webcrypto |
OLD | NEW |