Skip to content

Commit

Permalink
Fix CFB decryption performance in JS fallback for ciphers other than …
Browse files Browse the repository at this point in the history
…AES (#1679)

This issue affected non-AES ciphers (legacy), such as Cast5, in Node 18+ and in browser.
  • Loading branch information
larabr committed Sep 18, 2023
1 parent 5d02e3a commit 2ba8229
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/mode/cfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function decrypt(algo, key, ciphertext, iv) {
let j = 0;
while (chunk ? ct.length >= block_size : ct.length) {
const decblock = cipherfn.encrypt(blockp);
blockp = ct;
blockp = ct.subarray(0, block_size);
for (i = 0; i < block_size; i++) {
plaintext[j++] = blockp[i] ^ decblock[i];
}
Expand Down

0 comments on commit 2ba8229

Please sign in to comment.