RFR: 8267125: AES Galois CounterMode (GCM) interleaved implementation using AVX512 + VAES instructions [v4]

Valerie Peng valeriep at openjdk.java.net
Fri Jul 16 19:44:54 UTC 2021


On Fri, 16 Jul 2021 00:32:16 GMT, Valerie Peng <valeriep at 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/GaloisCounterMode.java line 629:
> 
>> 627:         GCTR gctr;
>> 628:         GHASH ghash;
>> 629:         GCMOperation op;
> 
> It seems clearer to initialize "op" in GCMEngine ctor since it's declared here. There is already logic in its method checking whether we are doing encryption or decryption.

Now that you have GCMOperation op, but there is still if-else blocks checking whether it's encryption/decryption and uses gctr and ghash instead of op. Looks like a bit adhoc? Can GaloisCounterMode.implGCMCrypt(...) just take GCMOperation op instead, no need for ct, ctOfs, gctr and ghash?

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

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


More information about the security-dev mailing list