summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/crypto_cipher_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node/crypto_cipher_test.ts')
-rw-r--r--cli/tests/unit_node/crypto_cipher_test.ts24
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");
+ },
+});