Skip to content

Commit

Permalink
fix: DES/Triple DES - failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoPombal committed Sep 16, 2024
1 parent 3eb1af0 commit 784b263
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/node/tests/nodeApi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length of 8 bytes (64 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> 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.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used as a default.");
assert.strictEqual(result[0].args.length, 5);
}),

Expand Down
12 changes: 4 additions & 8 deletions tests/operations/tests/Crypt.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 784b263

Please sign in to comment.