ascon: improve performance of permutation#118
Open
Gusted wants to merge 1 commit intoRustCrypto:masterfrom
Open
ascon: improve performance of permutation#118Gusted wants to merge 1 commit intoRustCrypto:masterfrom
Gusted wants to merge 1 commit intoRustCrypto:masterfrom
Conversation
Use a slightly different substitution implementation that is slightly
more efficient. This does require that the function is now strictly
seperated in the three layers.
The assembly with `-C opt-level=2` shows no weird instructions,
`permute_12` without `soft-compact` is fully unrolled and from and to
arrays is skipped. With `soft-compat` it's not unrolled but does also
skip from and to arrays between the iterations.
Benchmarks with and without soft-compat are quite similair (to the
point I'm guessing I'm not even running it correctly).
Permutation/1 round time: [4.6049 ns 4.6597 ns 4.7094 ns]
change: [-17.040% -15.975% -14.976%] (p = 0.00 < 0.05)
Permutation/6 rounds time: [17.179 ns 17.301 ns 17.452 ns]
change: [-27.748% -26.520% -25.229%] (p = 0.00 < 0.05)
Permutation/8 rounds time: [23.835 ns 23.979 ns 24.109 ns]
change: [-24.968% -24.238% -23.588%] (p = 0.00 < 0.05)
Permutation/12 rounds time: [33.011 ns 33.458 ns 33.882 ns]
change: [-25.656% -24.646% -23.615%] (p = 0.00 < 0.05)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use a slightly different substitution implementation that is slightly more efficient. This does require that the function is now strictly seperated in the three layers.
The assembly with
-C opt-level=2shows no weird instructions,permute_12withoutsoft-compactis fully unrolled and from and to arrays is skipped. Withsoft-compatit's not unrolled but does also skip from and to arrays between the iterations.Benchmarks with and without soft-compat are quite similair (to the point I'm guessing I'm not even running it correctly).