From 919ded1a0b3439ef0d2d3134603bf5840ea0a170 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 14 Jan 2022 14:18:53 +0530 Subject: feat(ext/crypto): implement AES-GCM decryption (#13319) --- cli/tests/unit/webcrypto_test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts index 3caa927ec..82ecae434 100644 --- a/cli/tests/unit/webcrypto_test.ts +++ b/cli/tests/unit/webcrypto_test.ts @@ -1444,6 +1444,15 @@ Deno.test(async function testAesGcmEncrypt() { // deno-fmt-ignore new Uint8Array([50,223,112,178,166,156,255,110,125,138,95,141,82,47,14,164,134,247,22]), ); + + const plainText = await crypto.subtle.decrypt( + { name: "AES-GCM", iv, additionalData: new Uint8Array() }, + key, + cipherText, + ); + assert(plainText instanceof ArrayBuffer); + assertEquals(plainText.byteLength, 3); + assertEquals(new Uint8Array(plainText), data); }); async function roundTripSecretJwk( -- cgit v1.2.3