-
Notifications
You must be signed in to change notification settings - Fork 661
Add AVX512VL-Optimized SHA3/SHAKE Implementations #2167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AVX512VL-Optimized SHA3/SHAKE Implementations #2167
Conversation
Co-authored-by: Tomasz Kantecki <[email protected]> Co-authored-by: Erdinc Ozturk <[email protected]> Signed-off-by: Marcel Cornu <[email protected]> Signed-off-by: Tomasz Kantecki <[email protected]>
Co-authored-by: Marcel Cornu <[email protected]> Signed-off-by: Tomasz Kantecki <[email protected]> Signed-off-by: Marcel Cornu <[email protected]>
Signed-off-by: Marcel Cornu <[email protected]>
Signed-off-by: Marcel Cornu <[email protected]>
Signed-off-by: Marcel Cornu <[email protected]>
|
Thanks for the contribution! Could you please add a CI test for this feature? |
What do you specifically mean by that? Wouldn't this code get activated automatically on any supported platform? If so then it would be a matter of ensuring the CI matrix does include such a platform. Are we able to do that? |
Ah, of course, it's enabled by default—my mistake. In that case, I think it would be good to add a CI config that explicitly switches the new option off in order to ensure that the AVX2 implementation still gets tested. I expect that the GitHub runners will support both. |
Sure. That can be done with OQS_USE_SHA3_AVX512VL=OFF. I'll add a config for that 👍 |
Signed-off-by: Marcel Cornu <[email protected]>
I looked into this and you're right that the free runners only support AVX2. I tested adding a CI test that uses Intel SDE to emulate running on Skylake and that works to run the AVX512 code path. However, it's quite slow and with a minimal build (ML-KEM & ML-DSA) it's timing out after an hour. I'll keep experimenting with that to try reduce the testing time. Let me know if there are any other suggestions. |
If you're not already doing this, what about building the library without the emulator and only using the emulator at the test stage? We also don't need to run all of the tests. |
Signed-off-by: Marcel Cornu <[email protected]>
Yes, that looks fine to me. Thank you! I see that the Travis build on s390x is failing, which is confusing to me since the GitHub UI says that it passed on a previous commit with no diff except for GitHub workflow files. I've re-triggered the Travis build and also triggered the Travis build on liboqs main as well in case it's an environment issue. Once that failure is resolved, this will be good to merge from my point of view. |
SWilson4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging as the same Travis failure is happening on main. Maybe an out of memory issue—pinging @bhess to take a look.
|
Thanks 👍 |
|
Thanks for the quick turnaround on this. Should I close the discussion now that this is merged? |
Yes please, and thanks again for contributing. |
This PR introduces new low-level implementations of the SHA3 and SHAKE algorithms using AVX512VL extensions as proposed in this discussion.
Summary of Changes:
Thank you for reviewing this contribution. We’re happy to make adjustments based on your feedback.