RFR: 8253821: Improve ByteBuffer performance with GCM [v3]

Anthony Scarpino ascarpino at openjdk.java.net
Mon Nov 2 22:09:03 UTC 2020


On Mon, 2 Nov 2020 19:56:20 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Anthony Scarpino has updated the pull request incrementally with six additional commits since the last revision:
>> 
>>  - style
>>  - style & comments
>>  - full update
>>  - remove old
>>  - update
>>  - outputsize
>
> src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java line 943:
> 
>> 941:             }
>> 942:         }
>> 943:         byte[] outBuffer = (internalOutput != null) ? internalOutput : output;
> 
> With this line of change, the decrypted bytes are written into the output buffer including padding bytes. Is it not?

If the output buffer provided is not big enough, it creates an internal one.  Two things happened here, one the variable was renamed because I felt "outWithPadding" was misleading.  The second was to only create this buffer when the length was smaller than the estimated length.  Before this change it would already create and use this buffer whether it was needed or not.

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

PR: https://git.openjdk.java.net/jdk/pull/411



More information about the security-dev mailing list