diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-03-14 15:59:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 15:59:23 +0900 |
commit | e80cc17dc43c26fe9dd1d1fb0dce80fc049cfffd (patch) | |
tree | c58f6679ede5df0e7d83e79e8c4bc7ee5e82c749 /cli/tests/unit_node/crypto_cipher_test.ts | |
parent | 9aa20b3ba758765863a4c1055097fda399efcfc3 (diff) |
fix(ext/node): add crypto.createCipheriv (#18091)
Diffstat (limited to 'cli/tests/unit_node/crypto_cipher_test.ts')
-rw-r--r-- | cli/tests/unit_node/crypto_cipher_test.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/tests/unit_node/crypto_cipher_test.ts b/cli/tests/unit_node/crypto_cipher_test.ts index e3bd7ca26..5fbaa548d 100644 --- a/cli/tests/unit_node/crypto_cipher_test.ts +++ b/cli/tests/unit_node/crypto_cipher_test.ts @@ -48,3 +48,27 @@ Deno.test({ ); }, }); + +Deno.test({ + name: "createCipheriv - basic", + fn() { + const cipher = crypto.createCipheriv( + "aes-128-cbc", + new Uint8Array(16), + new Uint8Array(16), + ); + assertEquals( + cipher.update(new Uint8Array(16), undefined, "hex"), + "66e94bd4ef8a2c3b884cfa59ca342b2e", + ); + assertEquals( + cipher.update(new Uint8Array(19), undefined, "hex"), + "f795bd4a52e29ed713d313fa20e98dbc", + ); + assertEquals( + cipher.update(new Uint8Array(55), undefined, "hex"), + "a10cf66d0fddf3405370b4bf8df5bfb347c78395e0d8ae2194da0a90abc9888a94ee48f6c78fcd518a941c3896102cb1", + ); + assertEquals(cipher.final("hex"), "e11901dde4a2f99fe4efc707e48c6aed"); + }, +}); |