| 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 "content/child/webcrypto/shared_crypto.h" | 5 #include "content/child/webcrypto/shared_crypto.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/child/webcrypto/crypto_data.h" | 8 #include "content/child/webcrypto/crypto_data.h" |
| 9 #include "content/child/webcrypto/platform_crypto.h" | 9 #include "content/child/webcrypto/platform_crypto.h" |
| 10 #include "content/child/webcrypto/webcrypto_util.h" | 10 #include "content/child/webcrypto/webcrypto_util.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 default: | 277 default: |
| 278 return Status::ErrorUnsupported(); | 278 return Status::ErrorUnsupported(); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 Status Digest(const blink::WebCryptoAlgorithm& algorithm, | 282 Status Digest(const blink::WebCryptoAlgorithm& algorithm, |
| 283 const CryptoData& data, | 283 const CryptoData& data, |
| 284 blink::WebArrayBuffer* buffer) { | 284 blink::WebArrayBuffer* buffer) { |
| 285 switch (algorithm.id()) { | 285 switch (algorithm.id()) { |
| 286 case blink::WebCryptoAlgorithmIdSha1: | 286 case blink::WebCryptoAlgorithmIdSha1: |
| 287 case blink::WebCryptoAlgorithmIdSha224: | |
| 288 case blink::WebCryptoAlgorithmIdSha256: | 287 case blink::WebCryptoAlgorithmIdSha256: |
| 289 case blink::WebCryptoAlgorithmIdSha384: | 288 case blink::WebCryptoAlgorithmIdSha384: |
| 290 case blink::WebCryptoAlgorithmIdSha512: | 289 case blink::WebCryptoAlgorithmIdSha512: |
| 291 return platform::DigestSha(algorithm.id(), data, buffer); | 290 return platform::DigestSha(algorithm.id(), data, buffer); |
| 292 default: | 291 default: |
| 293 return Status::ErrorUnsupported(); | 292 return Status::ErrorUnsupported(); |
| 294 } | 293 } |
| 295 } | 294 } |
| 296 | 295 |
| 297 Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, | 296 Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 key); | 565 key); |
| 567 } | 566 } |
| 568 default: | 567 default: |
| 569 return Status::ErrorUnsupported(); | 568 return Status::ErrorUnsupported(); |
| 570 } | 569 } |
| 571 } | 570 } |
| 572 | 571 |
| 573 } // namespace webcrypto | 572 } // namespace webcrypto |
| 574 | 573 |
| 575 } // namespace content | 574 } // namespace content |
| OLD | NEW |