| Index: content/renderer/webcrypto/webcrypto_util.cc
|
| diff --git a/content/renderer/webcrypto/webcrypto_util.cc b/content/renderer/webcrypto/webcrypto_util.cc
|
| index 977c282c63b72230c52704bb74a9691d04ee0eec..c5dff97892e12329d0c79bd35d97df10c0870a3e 100644
|
| --- a/content/renderer/webcrypto/webcrypto_util.cc
|
| +++ b/content/renderer/webcrypto/webcrypto_util.cc
|
| @@ -172,6 +172,21 @@ blink::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm(
|
| key_length_bits);
|
| }
|
|
|
| +unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id) {
|
| + switch (hash_id) {
|
| + case blink::WebCryptoAlgorithmIdSha1:
|
| + case blink::WebCryptoAlgorithmIdSha224:
|
| + case blink::WebCryptoAlgorithmIdSha256:
|
| + return 64;
|
| + case blink::WebCryptoAlgorithmIdSha384:
|
| + case blink::WebCryptoAlgorithmIdSha512:
|
| + return 128;
|
| + default:
|
| + NOTREACHED();
|
| + return 0;
|
| + }
|
| +}
|
| +
|
| } // namespace webcrypto
|
|
|
| } // namespace content
|
|
|