RFR: 8255557: Decouple GCM from CipherCore [v4]

Anthony Scarpino ascarpino at openjdk.java.net
Wed Jun 2 03:44:43 UTC 2021


On Thu, 20 May 2021 18:05:48 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 1014:
> 
>> 1012:                     len += gctrghash.update(buffer, 0, bLen, out, outOfs);
>> 1013:                     outOfs += bLen;
>> 1014:                 }
> 
> For encryption, would the ibuffer contain more than one blocksize of data? Isn't the existing impl only put the remaining input (less than a block) into it? Line 1013: the `outOfs += bLen;`, shouldn't 'bLen' be 'len'?

Actually this is related to one of your code review comments from the previous change that went into jdk16 for the code to be safe.  It sounds like you are comfortable removing this check?  I will remove it.
Yes, it should be 'len', proving the code never gets run

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

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



More information about the security-dev mailing list