RFR: 8341527: AVX-512 intrinsic for SHA3 [v4]

Volodymyr Paprotski duke at openjdk.org
Tue Oct 15 22:59:11 UTC 2024


On Tue, 15 Oct 2024 15:51:59 GMT, Ferenc Rakoczi <duke at openjdk.org> wrote:

> I was developing this as part of the ML-KEM and ML-DSA implementations, and there SHA3 is called quite frequently, so the test for those will test the SHA3 intrinsics, too.

I suppose it works. When possible, I rather have a more granular unit test (and we don't have the code for those algorithms yet. erm, right?)

> In a test, you can always just copy the pure Java implementation into the test and compare the results. During development of the intrinsics I like to use methods that return 0 from the intrinsic and 1 from the pure Java implementation and at the call sites, if the method returns 0 I also call the pure Java version (with a clone of the original inputs) and compare the results.

If you still have it and it can be 'made clean'..  I would love to see some of that 'scaffolding test code' kept for the final commit. (I like to imagine the 'final code cleanup' as 'removing **scaffolding** from a construction site' :) ) This will be especially useful if (when?) we revisit the intrinsic. (I can already see us also needing an AVX2 version.. someone will need to re-learn how to verify that intrinsic too)

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

PR Comment: https://git.openjdk.org/jdk/pull/21352#issuecomment-2415307895


More information about the hotspot-dev mailing list