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

Anthony Scarpino ascarpino at openjdk.java.net
Tue Nov 3 20:42:00 UTC 2020


On Tue, 3 Nov 2020 01:07:12 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/GCTR.java line 153:
>> 
>>> 151:             while (processed > MAX_LEN) {
>>> 152:                 encrypt(in, offset, MAX_LEN, out, 0);
>>> 153:                 dst.get(out, 0, MAX_LEN);
>> 
>> Shouldn't this be "put" instead of "get"?
>
> Yeah.. I'm surprised that wasn't caught by the tests.  I will look to see what case I need to make to check that.

So there is only one calling method that never gives this method it more than 16 bytes.  That is why testing never caught this.  But it doesn't hurt performance leaving the ability to call larger input sizes.

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

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


More information about the security-dev mailing list