On Wed, 19 May 2021 22:05:16 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 741:
> 
>> 739:                         } else {
>> 740:                             // If the remaining in buffer + data does 
>> not fill a
>> 741:                             // block, complete the gctr operation
> 
> This comment seems more suited for the else block below at line 753. In 
> addition, the criteria for completing the gctr operation should be whether 
> src still has remaining bytes left. It's possible that the (src.remaining() 
> == blockSize - over) and happen to fill up the block, right? The current flow 
> for this particular case would be an op.update(...) then continue down to 
> line 770-778, maybe you can adjust the if-check on line748 so this would go 
> through line 754-759 and return, i.e. the else block?

I changed the comment, but I also changed the code which will be in the next 
update

> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 
> line 752:
> 
>> 750:                             if (dst != null) {
>> 751:                                 dst.put(block, 0, blockSize);
>> 752:                             }
> 
> not counting this blockSize value into "processed"?

code is now changed

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

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

Reply via email to