From a811041fe2d98b1f5fa664b3968d0fee63619ee2 Mon Sep 17 00:00:00 2001 From: Michael Rowley Date: Tue, 22 Mar 2022 23:03:30 +0000 Subject: [PATCH] Corrected equivalence in AES key padding --- src/core/operations/AESDecrypt.mjs | 1 - src/core/operations/AESEncrypt.mjs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/operations/AESDecrypt.mjs b/src/core/operations/AESDecrypt.mjs index 8e16515b..b3381b01 100644 --- a/src/core/operations/AESDecrypt.mjs +++ b/src/core/operations/AESDecrypt.mjs @@ -126,7 +126,6 @@ class AESDecrypt extends Operation { } } if (targetKeySize !== 0) { - const originalLength = key.length; key = key.padEnd(targetKeySize, keyPadding == "Null" ? "\0" : key); } } diff --git a/src/core/operations/AESEncrypt.mjs b/src/core/operations/AESEncrypt.mjs index 42fb7b84..219dd007 100644 --- a/src/core/operations/AESEncrypt.mjs +++ b/src/core/operations/AESEncrypt.mjs @@ -119,8 +119,7 @@ class AESEncrypt extends Operation { } } if (targetKeySize !== 0) { - const originalLength = key.length; - key = key.padEnd(targetKeySize, keyPadding == "Null" ? "\0" : key); + key = key.padEnd(targetKeySize, keyPadding === "Null" ? "\0" : key); } }