| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 // Creates an RSA-OAEP algorithm. It is an error to call this with a hash_id | 232 // Creates an RSA-OAEP algorithm. It is an error to call this with a hash_id |
| 233 // that is not a SHA*. | 233 // that is not a SHA*. |
| 234 blink::WebCryptoAlgorithm CreateRsaOaepImportAlgorithm( | 234 blink::WebCryptoAlgorithm CreateRsaOaepImportAlgorithm( |
| 235 blink::WebCryptoAlgorithmId hash_id); | 235 blink::WebCryptoAlgorithmId hash_id); |
| 236 | 236 |
| 237 // TODO(eroman): Move to shared_crypto.cc | 237 // TODO(eroman): Move to shared_crypto.cc |
| 238 // Returns the internal block size for SHA-* | 238 // Returns the internal block size for SHA-* |
| 239 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); | 239 unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id); |
| 240 | 240 |
| 241 #ifdef WEBCRYPTO_HAS_KEY_ALGORITHM | |
| 242 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, | 241 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, |
| 243 unsigned keylen_bytes, | 242 unsigned keylen_bytes, |
| 244 blink::WebCryptoKeyAlgorithm* key_algorithm); | 243 blink::WebCryptoKeyAlgorithm* key_algorithm); |
| 245 #else | |
| 246 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, | |
| 247 unsigned keylen_bytes, | |
| 248 blink::WebCryptoAlgorithm* key_algorithm); | |
| 249 #endif | |
| 250 | 244 |
| 251 } // namespace webcrypto | 245 } // namespace webcrypto |
| 252 | 246 |
| 253 } // namespace content | 247 } // namespace content |
| 254 | 248 |
| 255 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 249 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
| OLD | NEW |