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_TEST_HELPERS_H_ | 5 #ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_TEST_HELPERS_H_ |
6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_TEST_HELPERS_H_ | 6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_TEST_HELPERS_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Extracts the key data bytes from |test| as used insome JSON test files. | 199 // Extracts the key data bytes from |test| as used insome JSON test files. |
200 std::vector<uint8_t> GetKeyDataFromJsonTestCase( | 200 std::vector<uint8_t> GetKeyDataFromJsonTestCase( |
201 const base::DictionaryValue* test, | 201 const base::DictionaryValue* test, |
202 blink::WebCryptoKeyFormat key_format); | 202 blink::WebCryptoKeyFormat key_format); |
203 | 203 |
204 // Reads the "crv" string from a JSON test case and returns it as a | 204 // Reads the "crv" string from a JSON test case and returns it as a |
205 // WebCryptoNamedCurve. | 205 // WebCryptoNamedCurve. |
206 blink::WebCryptoNamedCurve GetCurveNameFromDictionary( | 206 blink::WebCryptoNamedCurve GetCurveNameFromDictionary( |
207 const base::DictionaryValue* dict); | 207 const base::DictionaryValue* dict); |
208 | 208 |
| 209 // Creates an HMAC import algorithm whose inner hash algorithm is determined by |
| 210 // the specified algorithm ID. It is an error to call this method with a hash |
| 211 // algorithm that is not SHA*. |
| 212 blink::WebCryptoAlgorithm CreateHmacImportAlgorithm( |
| 213 blink::WebCryptoAlgorithmId hash_id, |
| 214 unsigned int length_bits); |
| 215 |
| 216 // Same as above but without specifying a length. |
| 217 blink::WebCryptoAlgorithm CreateHmacImportAlgorithmNoLength( |
| 218 blink::WebCryptoAlgorithmId hash_id); |
| 219 |
209 } // namespace webcrypto | 220 } // namespace webcrypto |
210 | 221 |
211 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_TEST_HELPERS_H_ | 222 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_TEST_HELPERS_H_ |
OLD | NEW |