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

Side by Side Diff: content/child/webcrypto/test/test_helpers.h

Issue 510583002: Improve a poor implementation of "find duplicates". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « no previous file | content/child/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Returns empty vector on failure. 91 // Returns empty vector on failure.
92 std::vector<uint8_t> GetBytesFromHexString(base::DictionaryValue* dict, 92 std::vector<uint8_t> GetBytesFromHexString(base::DictionaryValue* dict,
93 const char* property_name); 93 const char* property_name);
94 94
95 // Reads a string property with path "property_name" and converts it to a 95 // Reads a string property with path "property_name" and converts it to a
96 // WebCryptoAlgorith. Returns null algorithm on failure. 96 // WebCryptoAlgorith. Returns null algorithm on failure.
97 blink::WebCryptoAlgorithm GetDigestAlgorithm(base::DictionaryValue* dict, 97 blink::WebCryptoAlgorithm GetDigestAlgorithm(base::DictionaryValue* dict,
98 const char* property_name); 98 const char* property_name);
99 99
100 // Returns true if any of the vectors in the input list have identical content. 100 // Returns true if any of the vectors in the input list have identical content.
101 // Dumb O(n^2) implementation but should be fast enough for the input sizes that
102 // are used.
103 bool CopiesExist(const std::vector<std::vector<uint8_t> >& bufs); 101 bool CopiesExist(const std::vector<std::vector<uint8_t> >& bufs);
104 102
105 blink::WebCryptoAlgorithm CreateAesKeyGenAlgorithm( 103 blink::WebCryptoAlgorithm CreateAesKeyGenAlgorithm(
106 blink::WebCryptoAlgorithmId aes_alg_id, 104 blink::WebCryptoAlgorithmId aes_alg_id,
107 unsigned short length); 105 unsigned short length);
108 106
109 // The following key pair is comprised of the SPKI (public key) and PKCS#8 107 // The following key pair is comprised of the SPKI (public key) and PKCS#8
110 // (private key) representations of the key pair provided in Example 1 of the 108 // (private key) representations of the key pair provided in Example 1 of the
111 // NIST test vectors at 109 // NIST test vectors at
112 // ftp://ftp.rsa.com/pub/rsalabs/tmp/pkcs1v15sign-vectors.txt 110 // ftp://ftp.rsa.com/pub/rsalabs/tmp/pkcs1v15sign-vectors.txt
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 int key_len_bits, 168 int key_len_bits,
171 const blink::WebCryptoAlgorithm& import_algorithm, 169 const blink::WebCryptoAlgorithm& import_algorithm,
172 blink::WebCryptoKeyUsageMask usages, 170 blink::WebCryptoKeyUsageMask usages,
173 const std::string& jwk_alg); 171 const std::string& jwk_alg);
174 172
175 } // namespace webcrypto 173 } // namespace webcrypto
176 174
177 } // namesapce content 175 } // namesapce content
178 176
179 #endif // CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_ 177 #endif // CONTENT_CHILD_WEBCRYPTO_TEST_TEST_HELPERS_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698