On Thu, 20 May 2021 18:38:35 GMT, Valerie Peng <[email protected]> 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 1030:
>
>> 1028: inOfs += inLenUsed;
>> 1029: inLen -= inLenUsed;
>> 1030: outOfs += blockSize;
>
> 'blockSize' should be 'len'?
Either is fine because len and blockSize will be the same.
> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java
> line 1033:
>
>> 1031: ibuffer.reset();
>> 1032: // Code below will write the remainder from 'in'
>> to ibuffer
>> 1033: } else if (remainder > 0) {
>
> If bLen == 0, there is no need to put the rest of 'buffer' into 'ibuffer'.
> It looks strange that the remaining buffer data is stored back into
> 'ibuffer', then the code proceeds to encrypt 'in' from line 1043-1046. This
> looks incorrect as all prior buffered input should be processed before
> process current input.
code has changed. not applicable anymore
-------------
PR: https://git.openjdk.java.net/jdk/pull/4072