On Fri, 16 Jul 2021 20:49:20 GMT, Valerie Peng <valer...@openjdk.org> wrote:

>> Smita Kamath has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Updated AES-GCM intrinsic to match latest Java Code
>
> src/java.base/share/classes/com/sun/crypto/provider/GHASH.java line 146:
> 
>> 144:         }
>> 145:         state = new long[2];
>> 146:         subkeyHtbl = new long[2*57]; // 48 keys for the interleaved 
>> implementation, 8 for avx-ghash implementation and one for the original key
> 
> nit: the comment is too long, i.e. > 80

Ah.. I forgot I didn't change GHASH with my changes.. but I'll fix that thanks

> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 
> line 743:
> 
>> 741:                             dst.array(), dst.arrayOffset() + 
>> dst.position(),
>> 742:                             gctr, ghash);
>> 743:                     }
> 
> Can we use another ByteBuffer variable to avoid almost-duplicate calls?
> 
> ByteBuffer ct = (encryption? dst : src);
> rlen -= GaloisCounterMode.implGCMCrypt(src.array(),
>                             src.arrayOffset() + src.position(), 
> src.remaining(),
>                             ct.array(), ct.arrayOffset() + ct.position(),
>                             dst.array(), dst.arrayOffset() + dst.position(),
>                             gctr, ghash);

That maybe a better choice

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

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

Reply via email to