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 <sechash.h> | 5 #include <sechash.h> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/child/webcrypto/algorithm_implementation.h" | 9 #include "components/webcrypto/algorithm_implementation.h" |
10 #include "content/child/webcrypto/crypto_data.h" | 10 #include "components/webcrypto/crypto_data.h" |
11 #include "content/child/webcrypto/nss/util_nss.h" | 11 #include "components/webcrypto/nss/util_nss.h" |
12 #include "content/child/webcrypto/status.h" | 12 #include "components/webcrypto/status.h" |
13 #include "content/child/webcrypto/webcrypto_util.h" | 13 #include "components/webcrypto/webcrypto_util.h" |
14 #include "crypto/nss_util.h" | 14 #include "crypto/nss_util.h" |
15 #include "crypto/scoped_nss_types.h" | 15 #include "crypto/scoped_nss_types.h" |
16 | 16 |
17 namespace content { | |
18 | |
19 namespace webcrypto { | 17 namespace webcrypto { |
20 | 18 |
21 namespace { | 19 namespace { |
22 | 20 |
23 HASH_HashType WebCryptoAlgorithmToNSSHashType( | 21 HASH_HashType WebCryptoAlgorithmToNSSHashType( |
24 blink::WebCryptoAlgorithmId algorithm) { | 22 blink::WebCryptoAlgorithmId algorithm) { |
25 switch (algorithm) { | 23 switch (algorithm) { |
26 case blink::WebCryptoAlgorithmIdSha1: | 24 case blink::WebCryptoAlgorithmIdSha1: |
27 return HASH_AlgSHA1; | 25 return HASH_AlgSHA1; |
28 case blink::WebCryptoAlgorithmIdSha256: | 26 case blink::WebCryptoAlgorithmIdSha256: |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 AlgorithmImplementation* CreatePlatformShaImplementation() { | 147 AlgorithmImplementation* CreatePlatformShaImplementation() { |
150 return new ShaImplementation(); | 148 return new ShaImplementation(); |
151 } | 149 } |
152 | 150 |
153 scoped_ptr<blink::WebCryptoDigestor> CreatePlatformDigestor( | 151 scoped_ptr<blink::WebCryptoDigestor> CreatePlatformDigestor( |
154 blink::WebCryptoAlgorithmId algorithm) { | 152 blink::WebCryptoAlgorithmId algorithm) { |
155 return scoped_ptr<blink::WebCryptoDigestor>(new DigestorNSS(algorithm)); | 153 return scoped_ptr<blink::WebCryptoDigestor>(new DigestorNSS(algorithm)); |
156 } | 154 } |
157 | 155 |
158 } // namespace webcrypto | 156 } // namespace webcrypto |
159 | |
160 } // namespace content | |
OLD | NEW |