RFR: 8288047: Accelerate Poly1305 on x86_64 using AVX512 instructions [v4]

vpaprotsk duke at openjdk.org
Mon Oct 24 22:06:58 UTC 2022


On Tue, 18 Oct 2022 23:03:55 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> vpaprotsk has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>> 
>>  - assembler checks and test case fixes
>>  - Merge remote-tracking branch 'origin/master' into avx512-poly
>>  - Merge remote-tracking branch 'origin' into avx512-poly
>>  - further restrict UsePolyIntrinsics with supports_avx512vlbw
>>  - missed white-space fix
>>  - - Fix whitespace and copyright statements
>>    - Add benchmark
>>  - Merge remote-tracking branch 'vpaprotsk/master' into avx512-poly
>>  - Poly1305 AVX512 intrinsic for x86_64
>
> src/java.base/share/classes/com/sun/crypto/provider/Poly1305.java line 262:
> 
>> 260:     private static void processMultipleBlocks(byte[] input, int offset, int length, byte[] aBytes, byte[] rBytes) {
>> 261:         MutableIntegerModuloP A = ipl1305.getElement(aBytes).mutable();
>> 262:         MutableIntegerModuloP R = ipl1305.getElement(rBytes).mutable();
> 
> R doesn't need to be mutable.

done

> test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305IntrinsicFuzzTest.java line 39:
> 
>> 37:         public static void main(String[] args) throws Exception {
>> 38:                 //Note: it might be useful to increase this number during development of new Poly1305 intrinsics
>> 39:                 final int repeat = 100;
> 
> Should we increase this repeat count for the c2 compiler to kick in for compiling engineUpdate() and have the call to stub in place from there?

did it with `@run main/othervm -Xcomp -XX:-TieredCompilation com.sun.crypto.provider.Cipher.ChaCha20.Poly1305UnitTestDriver`

> test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305KAT.java line 133:
> 
>> 131:             System.out.println("*** Test " + ++testNumber + ": " +
>> 132:                     test.testName);
>> 133:             if (runSingleTest(test)) {
> 
> runSingleTest may need to be called enough number of times for the engineUpdate to be compiled by c2.

added a second copy with `@run main/othervm -Xcomp -XX:-TieredCompilation com.sun.crypto.provider.Cipher.ChaCha20.Poly1305UnitTestDriver`

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

PR: https://git.openjdk.org/jdk/pull/10582


More information about the security-dev mailing list