RFR: 8255557: Decouple GCM from CipherCore [v4]
Anthony Scarpino
ascarpino at openjdk.java.net
Wed Jun 2 17:56:45 UTC 2021
On Thu, 20 May 2021 20:00:07 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 1174:
>
>> 1172: inLen -= r;
>> 1173: r = gctrghash.update(block, 0, blockSize, out,
>> 1174: outOfs + resultLen);
>
> I don't follow why you don't update the 'outOfs' after the line 1161 doUpdate() call and then add the resultLen when calling gctrhash.update(...) here. Seems fragile and difficult to maintain?
i cleaned it up.. all the += or -+ are annoying, but not there is much i can do
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 1213:
>
>> 1211:
>> 1212: // copy the tag to the end of the buffer
>> 1213: System.arraycopy(block, 0, out, resultLen + outOfs, tagLenBytes);
>
> Now that the tag is copied to the output, why not increment resultLen w/ tagLenBytes? This way, you don't have to keep repeating the (resultLen + tagLenBytes) for another two times?
yeah, that got changed after this comment
-------------
PR: https://git.openjdk.java.net/jdk/pull/4072
More information about the security-dev
mailing list