On Wed, 19 May 2021 21:18:27 GMT, Valerie Peng <valer...@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 640:
> 
>> 638:          * @return number of bytes used from 'in'
>> 639:          */
>> 640:         int mergeBlock(byte[] buffer, int bufOfs, int bufLen, byte[] in,
> 
> Can be made 'static'?

mergeBlock contains blockSize which isn't static

> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 
> line 648:
> 
>> 646: 
>> 647:             System.arraycopy(buffer, bufOfs, block, 0, bufLen);
>> 648:             int inUsed = Math.min(block.length - bufLen,
> 
> Seems equivalent to `int inUsed = Math.min((block.length - bufLen), inLen);`?

I think you're right.. and my main test seems to be ok with it too

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

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

Reply via email to