yescrypt: Use AVX512VL XOP-like bit rotates for faster Salsa20 #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This speeds up classic scrypt by up to a third, but yescrypt only very slightly. It also reduces code size.
This would only be enabled in builds that support AVX512VL, which I guess is currently uncommon for libxcrypt (even though CPUs that support it are pretty common by now). So maybe in distros like Gentoo where packages are commonly built from source for the local machine?
It shouldn't hurt to have this in the source code anyhow, except that it'd not be part of usual coverage testing - so I suggest occasional testing of a
-march=native
build on a recent CPU, which would be a good idea prior to these changes as well.I got the same changes into upstream yescrypt, its fork in JtR tree, and yespower earlier today. The AVX512VL code passed tests in all 3 of these on Intel Tiger Lake.
I did not actually test these changes in libxcrypt yet.