From 3394c4df751229b6ce2349e84dccdee26faecb67 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 28 Aug 2024 18:34:18 +0530 Subject: fix(ext/node): update aead-gcm-stream to 0.3 (#25261) Fixes https://github.com/denoland/deno/issues/25260 Fixes https://github.com/denoland/deno/issues/25254 Fixes https://github.com/denoland/deno/issues/23693 Verified that `web-push` GCM decryption works in the browser. See `aead-gcm-stream` changes [here](https://github.com/littledivy/aead-gcm-stream/commit/a9ffd0c07c14e4b566c87bf51a20ff799b9e7f5e) --- tests/unit_node/crypto/crypto_cipher_gcm_test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/unit_node/crypto') diff --git a/tests/unit_node/crypto/crypto_cipher_gcm_test.ts b/tests/unit_node/crypto/crypto_cipher_gcm_test.ts index e87ae23f0..b379a4369 100644 --- a/tests/unit_node/crypto/crypto_cipher_gcm_test.ts +++ b/tests/unit_node/crypto/crypto_cipher_gcm_test.ts @@ -101,3 +101,21 @@ for ( }); } } + +Deno.test({ + name: "aes-128-gcm encrypt multiple", + fn() { + const key = Buffer.alloc(16); + const nonce = Buffer.alloc(12); + + const gcm = crypto.createCipheriv("aes-128-gcm", key, nonce); + + assertEquals(gcm.update("hello", "utf8", "hex"), "6bedb6a20f"); + assertEquals(gcm.update("world", "utf8", "hex"), "c1cce09f4c"); + gcm.final(); + assertEquals( + gcm.getAuthTag().toString("hex"), + "bf6d20a38e0c828bea3de63b7ff1dfbd", + ); + }, +}); -- cgit v1.2.3