On Thu, 20 May 2021 19:06:31 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 1055:
> 
>> 1053:                 // remainder offset is based on original buffer length
>> 1054:                 ibuffer.write(in, inOfs + inLen, remainder);
>> 1055:             }
> 
> I wonder if these update(byte[], int, int, byte[], int) calls (such as the 
> one on line 1045) should take ibuffer and stores the unprocessed bytes into 
> it. This way seems more robust and you won't need separate logic. Same 
> comment for the doUpdate() taking ByteBuffer arguments.

Do you mean having all the GCM interface implementations have an argument that 
takes ibuffer and adds any unprocessed data into?  Maybe it would save a copy 
of the code, but I'm not sure I like GCTR or GHASH adding data into the ibuffer.

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

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

Reply via email to