RFR: 8267125: AES Galois CounterMode (GCM) interleaved implementation using AVX512 + VAES instructions [v7]
Valerie Peng
valeriep at openjdk.java.net
Mon Aug 9 17:21:38 UTC 2021
On Fri, 6 Aug 2021 20:37:22 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:
>> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 1120:
>>
>>> 1118: inOfs += r;
>>> 1119: inLen -= r;
>>> 1120: }
>>
>> Have you considered move the "if (inLen >= PARALLEL_LEN) block" into EncryptOp.update() impl (just like the Encrypt.doFinal() impl) ? Even though not all op.update() calls process large data, but it'd reduce code duplication and ensures that all large data processed by EncryptOp.update() calls would call the intrinsified method.
>
> There are cases where inLen is known to be smaller than PARALLEL_LEN and is a waste of a check, such as merging with the ibuffer to create one block. Also moving it into EncryptOp would always mean an additional check and maybe an unnecessary jump to another method.
>
> I did that for doFinal, because gctr/ghash.doFinal() needs to was no extra checks.
Alright, as long as you did consider that.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4019
More information about the hotspot-compiler-dev
mailing list