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

Valerie Peng valeriep at openjdk.java.net
Mon Nov 16 19:26:15 UTC 2020


On Sat, 14 Nov 2020 00:33:35 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 818:
>> 
>>> 816:         // do this check here can also catch the potential integer overflow
>>> 817:         // scenario for the subsequent output buffer capacity check.
>>> 818:         checkDataLength(0, len);
>> 
>> Perhaps this can be moved up to the beginning of this method just like the dst size check?
>
> You don't know what 'len', which includes ibuffer data, until this point in the code.

Well, didn't you already calcuate the 'len' value in the beginning of the copied-from-GCTR RuntimeException check?

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

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



More information about the security-dev mailing list