RFR: 8255557: Decouple GCM from CipherCore [v4]

Anthony Scarpino ascarpino at openjdk.java.net
Wed Jun 2 20:26:50 UTC 2021


On Fri, 21 May 2021 01:19:44 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Anthony Scarpino has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix perf problem by reorganizing doLastBlock()
>
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 1610:
> 
>> 1608:                     // update the input parameters for what was taken out of 'in'
>> 1609:                     inOfs += inUsed;
>> 1610:                     inLen -= inUsed;
> 
> This merge block code won't be needed if inLen == 0, i.e. can just assign in to be buffer, inOfs to 0, and inLen to bufRemaining.

You are correct, but it's not that simple to handle this case without adding more if()'s which I've found can slow down overall performance.  I'm hesitant change this code for this case

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

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



More information about the security-dev mailing list