| 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 #ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ | 5 #ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ |
| 6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ | 6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 #include <stdint.h> | 12 #include <stdint.h> |
| 13 | 13 |
| 14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" | 14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
| 15 #include "third_party/WebKit/public/platform/WebCryptoKey.h" | 15 #include "third_party/WebKit/public/platform/WebCryptoKey.h" |
| 16 #include "third_party/boringssl/src/include/openssl/base.h" | 16 #include "third_party/boringssl/src/include/openssl/base.h" |
| 17 | 17 |
| 18 // This file contains miscellaneous helpers that don't belong in any of the | 18 // This file contains miscellaneous helpers that don't belong in any of the |
| 19 // other *_util.h | 19 // other *_util.h |
| 20 | 20 |
| 21 namespace webcrypto { | 21 namespace webcrypto { |
| 22 | 22 |
| 23 class CryptoData; | 23 class CryptoData; |
| 24 class GenerateKeyResult; | |
| 25 class Status; | 24 class Status; |
| 26 | 25 |
| 27 // Returns the EVP_MD that corresponds with |hash_algorithm|, or nullptr on | 26 // Returns the EVP_MD that corresponds with |hash_algorithm|, or nullptr on |
| 28 // failure. | 27 // failure. |
| 29 const EVP_MD* GetDigest(const blink::WebCryptoAlgorithm& hash_algorithm); | 28 const EVP_MD* GetDigest(const blink::WebCryptoAlgorithm& hash_algorithm); |
| 30 | 29 |
| 31 // Returns the EVP_MD that corresponds with |id|, or nullptr on failure. | 30 // Returns the EVP_MD that corresponds with |id|, or nullptr on failure. |
| 32 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id); | 31 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id); |
| 33 | 32 |
| 34 // Truncates an octet string to a particular bit length. This is accomplished by | 33 // Truncates an octet string to a particular bit length. This is accomplished by |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const CryptoData& data, | 79 const CryptoData& data, |
| 81 unsigned int tag_length_bytes, | 80 unsigned int tag_length_bytes, |
| 82 const CryptoData& iv, | 81 const CryptoData& iv, |
| 83 const CryptoData& additional_data, | 82 const CryptoData& additional_data, |
| 84 const EVP_AEAD* aead_alg, | 83 const EVP_AEAD* aead_alg, |
| 85 std::vector<uint8_t>* buffer); | 84 std::vector<uint8_t>* buffer); |
| 86 | 85 |
| 87 } // namespace webcrypto | 86 } // namespace webcrypto |
| 88 | 87 |
| 89 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ | 88 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_UTIL_H_ |
| OLD | NEW |