RFR: 8344144: AES/CBC slow at big payloads [v2]
Anthony Scarpino
ascarpino at openjdk.org
Thu Nov 14 20:54:03 UTC 2024
On Thu, 14 Nov 2024 17:20:14 GMT, Artur Barashev <abarashev at openjdk.org> wrote:
>> Volodymyr Paprotski has updated the pull request incrementally with one additional commit since the last revision:
>>
>> comments from Kevin
>
> src/java.base/share/classes/com/sun/crypto/provider/CipherBlockChaining.java line 222:
>
>> 220: processed +=
>> 221: implDecrypt(cipher, cipherOffset, cipherLen, plain, plainOffset);
>> 222: return processed;
>
> The `for` loop logic is the same for encrypt and decrypt operations, only different positioning of the arguments. How about creating a helper method `chunkOperation` that would take one additional encrypt/decrypt boolean argument based on which it would do either encrypt or decrypt operation.
Given this is a performance change, I'm fine with leaving it as is. Jumping to a helper method with an encrypt/decrypt conditional check for every crypto op will costs performance. This is a case where more efficient code is more verbose syntax.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22086#discussion_r1842871281
More information about the security-dev
mailing list