[jdk11u-dev] RFR: 8280703: CipherCore.doFinal(...) causes potentially massive byte[] allocations during decryption [v5]

Christoph Langer clanger at openjdk.org
Mon Mar 6 15:59:14 UTC 2023


On Wed, 1 Mar 2023 19:09:45 GMT, Scott Gibbons <sgibbons at openjdk.org> wrote:

>> Backporting because this change results in ~3x performance improvement in AES-CTR.
>> 
>> Risk is low.  Tested with tier1 and benchmark.
>> 
>> The PR does not backport cleanly.  The buffer name was changed, but functionally remains the same.
>
> Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix initialization of offset

src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java line 971:

> 969:     private void endDoFinal() {
> 970:         buffered = 0;
> 971:         diffBlocksize = blockSize;

Here the variable should remain outWithPadding.

src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java line 973:

> 971:         diffBlocksize = blockSize;
> 972:         if (cipherMode != ECB_MODE) {
> 973:             cipher.reset();

Same here.

-------------

PR: https://git.openjdk.org/jdk11u-dev/pull/1780


More information about the jdk-updates-dev mailing list