Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: components/webcrypto/algorithms/test_helpers.h

Issue 1355873002: [refactor] More post-NSS WebCrypto cleanups (utility functions). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address David's comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/secret_key_util.cc ('k') | components/webcrypto/algorithms/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698