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

Anthony Scarpino ascarpino at openjdk.java.net
Thu Oct 8 15:35:29 UTC 2020


On Wed, 7 Oct 2020 20:56:06 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Anthony Scarpino has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Xuelei comments
>
> src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java line 1253:
> 
>> 1251:         if (decrypting) {
>> 1252:             if (buffered > 0) {
>> 1253:                 cipher.decrypt(buffer, 0, buffered, new byte[0], 0);
> 
> This looks a bit strange? The output buffer is 0-length which would lead to ShortBufferException when the buffered
> bytes is enough to produce some output.

This is right.  decrypt() puts the data into GaloisCounterMode.ibuffer and never uses the output

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

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



More information about the security-dev mailing list