diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-02-16 16:27:14 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 16:27:14 +0530 |
commit | 77a9683425357f106614fc04dcac5654cd4aeece (patch) | |
tree | 818c8869528ea6d4753d52b5661f0ec3f2e4ed61 /cli/tests/unit/webcrypto_test.ts | |
parent | 074f53234a161b3ef02d3d28e3ff16053fa69a5a (diff) |
fix(ext/crypto): optional additionalData in encrypt/decrypt (#13669)
Diffstat (limited to 'cli/tests/unit/webcrypto_test.ts')
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts index 0e7e2829a..c942e36c6 100644 --- a/cli/tests/unit/webcrypto_test.ts +++ b/cli/tests/unit/webcrypto_test.ts @@ -1443,7 +1443,7 @@ Deno.test(async function testAesGcmEncrypt() { const data = new Uint8Array([1, 2, 3]); const cipherText = await crypto.subtle.encrypt( - { name: "AES-GCM", iv, additionalData: new Uint8Array() }, + { name: "AES-GCM", iv }, key, data, ); @@ -1457,7 +1457,7 @@ Deno.test(async function testAesGcmEncrypt() { ); const plainText = await crypto.subtle.decrypt( - { name: "AES-GCM", iv, additionalData: new Uint8Array() }, + { name: "AES-GCM", iv }, key, cipherText, ); @@ -1655,14 +1655,14 @@ Deno.test(async function testAesGcmTagLength() { // encrypt won't fail, it will simply truncate the tag // as expected. const encrypted = await crypto.subtle.encrypt( - { name: "AES-GCM", iv, tagLength: 96, additionalData: new Uint8Array() }, + { name: "AES-GCM", iv, tagLength: 96 }, key, new Uint8Array(32), ); await assertRejects(async () => { await crypto.subtle.decrypt( - { name: "AES-GCM", iv, tagLength: 96, additionalData: new Uint8Array() }, + { name: "AES-GCM", iv, tagLength: 96 }, key, encrypted, ); |