From 784b2631a83a6a543c2c70aa18bde016f7bcab5e Mon Sep 17 00:00:00 2001 From: Francisco Pombal Date: Mon, 16 Sep 2024 15:44:28 +0100 Subject: [PATCH] fix: DES/Triple DES - failing tests --- tests/node/tests/nodeApi.mjs | 2 +- tests/operations/tests/Crypt.mjs | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/node/tests/nodeApi.mjs b/tests/node/tests/nodeApi.mjs index 8992ed369a..29a47ffc8d 100644 --- a/tests/node/tests/nodeApi.mjs +++ b/tests/node/tests/nodeApi.mjs @@ -119,7 +119,7 @@ TestRegister.addApiTests([ assert.strictEqual(result[0].module, "Ciphers"); assert.strictEqual(result[0].inputType, "string"); assert.strictEqual(result[0].outputType, "string"); - assert.strictEqual(result[0].description, "Triple DES applies DES three times to each block to increase key size.

Key: Triple DES uses a key length of 24 bytes (192 bits).
DES uses a key length of 8 bytes (64 bits).

IV: The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.

Padding: In CBC and ECB mode, PKCS#7 padding will be used as a default."); + assert.strictEqual(result[0].description, "Triple DES applies DES three times to each block to increase key size.

Key: Triple DES uses a key length of 24 bytes (192 bits).

IV: The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.

Padding: In CBC and ECB mode, PKCS#7 padding will be used as a default."); assert.strictEqual(result[0].args.length, 5); }), diff --git a/tests/operations/tests/Crypt.mjs b/tests/operations/tests/Crypt.mjs index 69123d66e2..5f5ec24d99 100644 --- a/tests/operations/tests/Crypt.mjs +++ b/tests/operations/tests/Crypt.mjs @@ -580,8 +580,7 @@ Tag: a8f04c4d93bbef82bef61a103371aef9`, input: "", expectedOutput: `Invalid key length: 0 bytes -DES uses a key length of 8 bytes (64 bits). -Triple DES uses a key length of 24 bytes (192 bits).`, +DES uses a key length of 8 bytes (64 bits).`, recipeConfig: [ { "op": "DES Encrypt", @@ -674,8 +673,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`, input: "", expectedOutput: `Invalid key length: 0 bytes -Triple DES uses a key length of 24 bytes (192 bits). -DES uses a key length of 8 bytes (64 bits).`, +Triple DES uses a key length of 24 bytes (192 bits).`, recipeConfig: [ { "op": "Triple DES Encrypt", @@ -1300,8 +1298,7 @@ The following algorithms will be used based on the size of the key: input: "", expectedOutput: `Invalid key length: 0 bytes -DES uses a key length of 8 bytes (64 bits). -Triple DES uses a key length of 24 bytes (192 bits).`, +DES uses a key length of 8 bytes (64 bits).`, recipeConfig: [ { "op": "DES Decrypt", @@ -1394,8 +1391,7 @@ Triple DES uses a key length of 24 bytes (192 bits).`, input: "", expectedOutput: `Invalid key length: 0 bytes -Triple DES uses a key length of 24 bytes (192 bits). -DES uses a key length of 8 bytes (64 bits).`, +Triple DES uses a key length of 24 bytes (192 bits).`, recipeConfig: [ { "op": "Triple DES Decrypt",