Chromium Code Reviews| Index: content/child/webcrypto/shared_crypto.cc |
| diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc |
| index af2beaca2a672fbbca28886ed65115dfb49e5112..c5b448468b1ae61ab2a595db87532a2db5bc5edf 100644 |
| --- a/content/child/webcrypto/shared_crypto.cc |
| +++ b/content/child/webcrypto/shared_crypto.cc |
| @@ -10,6 +10,7 @@ |
| #include "content/child/webcrypto/status.h" |
| #include "content/child/webcrypto/webcrypto_util.h" |
| #include "crypto/secure_util.h" |
| +#include "jwk.h" |
|
eroman
2014/03/25 23:43:37
use a full path:
"content/child/webcrypto/jwk.h"
padolph
2014/03/26 00:01:46
Oops, sorry. Done.
|
| #include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h" |
| #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| #include "third_party/WebKit/public/platform/WebCryptoKey.h" |
| @@ -483,6 +484,21 @@ Status WrapKeyExportAndEncrypt( |
| wrapping_algorithm, wrapping_key, CryptoData(exported_data), buffer); |
| } |
| +// Returns the internal block size for SHA-* |
| +unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id) { |
| + switch (hash_id) { |
| + case blink::WebCryptoAlgorithmIdSha1: |
| + case blink::WebCryptoAlgorithmIdSha256: |
| + return 64; |
| + case blink::WebCryptoAlgorithmIdSha384: |
| + case blink::WebCryptoAlgorithmIdSha512: |
| + return 128; |
| + default: |
| + NOTREACHED(); |
| + return 0; |
| + } |
| +} |
| + |
| } // namespace |
| void Init() { platform::Init(); } |