RFR: 8247645: ChaCha20 intrinsics [v4]

Vladimir Ivanov vlivanov at openjdk.org
Tue Nov 22 00:53:27 UTC 2022


On Mon, 21 Nov 2022 06:28:32 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 incrementally with one additional commit since the last revision:
> 
>   Pull out common macro code into function parameter pack

Looks good.

src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp line 107:

> 105:     if (VM_Version::supports_evex()) {
> 106:       StubRoutines::_chacha20Block = generate_chacha20Block_avx512();
> 107:     } else {    // Either AVX or AVX2 is supported

Worth to supplement the comment with an assert (either `UseAVX > 0` or `VM_Version::supports_avx() == true`).

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

Marked as reviewed by vlivanov (Reviewer).

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


More information about the security-dev mailing list