| 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/evp.h> | 5 #include <openssl/aead.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/numerics/safe_math.h" | 13 #include "base/numerics/safe_math.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "components/webcrypto/algorithms/aes.h" | 15 #include "components/webcrypto/algorithms/aes.h" |
| 16 #include "components/webcrypto/algorithms/util.h" | 16 #include "components/webcrypto/algorithms/util.h" |
| 17 #include "components/webcrypto/blink_key_handle.h" | 17 #include "components/webcrypto/blink_key_handle.h" |
| 18 #include "components/webcrypto/crypto_data.h" | 18 #include "components/webcrypto/crypto_data.h" |
| 19 #include "components/webcrypto/status.h" | 19 #include "components/webcrypto/status.h" |
| 20 #include "crypto/openssl_util.h" | 20 #include "crypto/openssl_util.h" |
| 21 #include "crypto/scoped_openssl_types.h" | |
| 22 | 21 |
| 23 namespace webcrypto { | 22 namespace webcrypto { |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| 26 | 25 |
| 27 const EVP_AEAD* GetAesKwAlgorithmFromKeySize(size_t key_size_bytes) { | 26 const EVP_AEAD* GetAesKwAlgorithmFromKeySize(size_t key_size_bytes) { |
| 28 switch (key_size_bytes) { | 27 switch (key_size_bytes) { |
| 29 case 16: | 28 case 16: |
| 30 return EVP_aead_aes_128_key_wrap(); | 29 return EVP_aead_aes_128_key_wrap(); |
| 31 case 32: | 30 case 32: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 80 } |
| 82 }; | 81 }; |
| 83 | 82 |
| 84 } // namespace | 83 } // namespace |
| 85 | 84 |
| 86 std::unique_ptr<AlgorithmImplementation> CreateAesKwImplementation() { | 85 std::unique_ptr<AlgorithmImplementation> CreateAesKwImplementation() { |
| 87 return base::WrapUnique(new AesKwImplementation); | 86 return base::WrapUnique(new AesKwImplementation); |
| 88 } | 87 } |
| 89 | 88 |
| 90 } // namespace webcrypto | 89 } // namespace webcrypto |
| OLD | NEW |