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

Christoph Langer clanger at openjdk.org
Sun Mar 5 21:21:16 UTC 2023


The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.

----------------------------------------------------------------------
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

I had a closer look now. Overall it seems ok. Could you maybe rename outWithPadding to internalOutput? That would bring the code closer to head and seems the more logical name for the buffer. Thanks.

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

> 957:             }
> 958:             // copy the result into user-supplied output buffer
> 959:             if(outWithPadding != null) {

Please add a space after `if`

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

Changes requested by clanger (Reviewer).

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


More information about the jdk-updates-dev mailing list