RFR: 8247645: ChaCha20 intrinsics [v5]

Anthony Scarpino ascarpino at openjdk.org
Tue Nov 29 00:32:36 UTC 2022


On Tue, 22 Nov 2022 05:28:05 GMT, Jamil Nimeh <jnimeh at openjdk.org> wrote:

>> This PR delivers ChaCha20 intrinsics that accelerate the core block function that generates key stream from the key, counter and nonce.  Intrinsics have been written for the following platforms and instruction sets:
>> 
>> - x86_64: AVX, AVX2 and AVX512
>> - aarch64: platforms that support the advanced SIMD instructions
>> 
>> Note: Microbenchmark results moved to a comment in the PR so we don't have to see it in every email.
>> 
>> Special thanks to the folks who have made many helpful comments while this PR was in draft form.
>
> Jamil Nimeh has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 50 commits:
> 
>  - Merge with main
>  - Add AVX assertion guard
>  - Pull out common macro code into function parameter pack
>  - replace hi/lo word shuffles and left-right shift/or operations for vpshufd on byte-aligned rotations
>  - Change intrinsic helper method name conform to convention
>  - consolidate chacha macroAssembler routines into chacha stubGenerator file
>  - More indentation fixes on aarch64
>  - rename chapoly->chacha for macro file
>  - rename chacha macro file to be consistent with x86_64 naming
>  - Fix indentation issues
>  - ... and 40 more: https://git.openjdk.org/jdk/compare/392ac705...bb3f4264

src/java.base/share/classes/com/sun/crypto/provider/ChaCha20Cipher.java line 92:

> 90:     private long counter;
> 91: 
> 92:     // The 16-int state array and output keystream array:

I think it would help readability if these comments were separated for each declaration

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

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


More information about the security-dev mailing list