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

2021-08-11 Thread Andrew Haley
On Mon, 9 Aug 2021 15:49:07 GMT, Smita Kamath  wrote:

>> I would like to submit AES-GCM optimization for x86_64 architectures 
>> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES 
>> and GHASH operations.
>> Performance gain of ~1.5x - 2x for message sizes 8k and above.
>
> Smita Kamath has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   rewiew update

src/hotspot/cpu/x86/macroAssembler_x86_aes.cpp line 1682:

> 1680: vpshufb(AAD_HASHx, AAD_HASHx, xmm24, Assembler::AVX_128bit);
> 1681: 
> 1682: // Compute #rounds for AES based on the length of the key array

Forget that, it's done everywhere. Deleted.

-

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


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

2021-08-11 Thread Andrew Haley
On Mon, 9 Aug 2021 15:49:07 GMT, Smita Kamath  wrote:

>> I would like to submit AES-GCM optimization for x86_64 architectures 
>> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES 
>> and GHASH operations.
>> Performance gain of ~1.5x - 2x for message sizes 8k and above.
>
> Smita Kamath has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   rewiew update

src/hotspot/cpu/x86/macroAssembler_x86_aes.cpp line 1682:

> 1680: vpshufb(AAD_HASHx, AAD_HASHx, xmm24, Assembler::AVX_128bit);
> 1681: 
> 1682: // Compute #rounds for AES based on the length of the key array

This is a bit of a hack. Wouldn't it make more sense to pass in the array oop, 
then derive both the length and the address of the base of the key array from 
the oop, rather than using a negative offset from the base address?

-

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


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

2021-08-10 Thread Andrew Haley
On Mon, 9 Aug 2021 15:49:07 GMT, Smita Kamath  wrote:

>> I would like to submit AES-GCM optimization for x86_64 architectures 
>> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES 
>> and GHASH operations.
>> Performance gain of ~1.5x - 2x for message sizes 8k and above.
>
> Smita Kamath has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   rewiew update

src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 
694:

> 692: 
> 693: /**
> 694:  *  ByteBuffer wrapper for intrinsic implGCMCrypt.  It will 
> operation

Suggestion:

 *  ByteBuffer wrapper for intrinsic implGCMCrypt.  It will operate

-

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


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

2021-08-09 Thread Valerie Peng
On Mon, 9 Aug 2021 15:49:07 GMT, Smita Kamath  wrote:

>> I would like to submit AES-GCM optimization for x86_64 architectures 
>> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES 
>> and GHASH operations.
>> Performance gain of ~1.5x - 2x for message sizes 8k and above.
>
> Smita Kamath has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   rewiew update

src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java line 
1652:

> 1650: outOfs += resultLen;
> 1651: len += resultLen;
> 1652: }

Seems redundant since DecryptOp.doFinal(..) already has this check?

-

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


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

2021-08-09 Thread Smita Kamath
> I would like to submit AES-GCM optimization for x86_64 architectures 
> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES 
> and GHASH operations.
> Performance gain of ~1.5x - 2x for message sizes 8k and above.

Smita Kamath has updated the pull request incrementally with one additional 
commit since the last revision:

  rewiew update

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4019/files
  - new: https://git.openjdk.java.net/jdk/pull/4019/files/69145008..ecf8e6d7

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4019&range=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4019&range=06-07

  Stats: 29 lines in 1 file changed: 12 ins; 5 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4019.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4019/head:pull/4019

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