From 3014696fcd4a5baa255078cecfd9a4c8efcfa8fc Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Tue, 1 Oct 2019 23:10:54 +0100 Subject: [PATCH] Adapt API tests to comply with length requirements --- tests/node/tests/operations.mjs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index ac846d93..e6cbcf50 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -183,27 +183,29 @@ Full hash: $2a$10$ODeP1.6fMsb.ENk2ngPUCO7qTGVPyHA9TqDVcyupyed8FjsiF65L6`; it("Blowfish encrypt", () => { const result = chef.blowfishEncrypt("Fool's Gold", { key: { - string: "One", + string: "0011223344556677", option: "hex", }, iv: { - string: "Two", + string: "exparrot", option: "utf8" - } + }, + mode: "CBC" }); - assert.strictEqual(result.toString(), "8999b513bf2ff064b2977dea7e05f1b5"); + assert.strictEqual(result.toString(), "55a2838980078ffe1722b08d5fa1d481"); }), it("Blowfish decrypt", () => { - const result = chef.blowfishDecrypt("8999b513bf2ff064b2977dea7e05f1b5", { + const result = chef.blowfishDecrypt("55a2838980078ffe1722b08d5fa1d481", { key: { - string: "One", + string: "0011223344556677", option: "hex", }, iv: { - string: "Two", + string: "exparrot", option: "utf8", - } + }, + mode: "CBC" }); assert.strictEqual(result.toString(), "Fool's Gold"); }),