diff options
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 2 | ||||
-rw-r--r-- | ext/crypto/00_crypto.js | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts index 48d7012db..13fb2d3f7 100644 --- a/cli/tests/unit/webcrypto_test.ts +++ b/cli/tests/unit/webcrypto_test.ts @@ -675,7 +675,7 @@ Deno.test(async function testDeriveKey() { const algorithm = derivedKey.algorithm as HmacKeyAlgorithm; assertEquals(algorithm.name, "HMAC"); assertEquals(algorithm.hash.name, "SHA-256"); - assertEquals(algorithm.length, 256); + assertEquals(algorithm.length, 512); }); Deno.test(async function testAesCbcEncryptDecrypt() { diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 7b21c9287..857283623 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -393,16 +393,16 @@ if (algorithm.length === undefined) { switch (algorithm.hash.name) { case "SHA-1": - length = 160; + length = 512; break; case "SHA-256": - length = 256; + length = 512; break; case "SHA-384": - length = 384; + length = 1024; break; case "SHA-512": - length = 512; + length = 1024; break; default: throw new DOMException( |