diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-01-14 14:18:53 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 14:18:53 +0530 |
commit | 919ded1a0b3439ef0d2d3134603bf5840ea0a170 (patch) | |
tree | 9ce91bff89b9e3c525f357b4e4b686d5f4edbff0 /cli/tests | |
parent | eda6e58520276786bd87e411d0284eb56d9686a6 (diff) |
feat(ext/crypto): implement AES-GCM decryption (#13319)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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( |