Commit 1a42ef8
committed
ascon: improve performance of permutation
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)1 parent 8b2c41b commit 1a42ef8
2 files changed
+32
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
0 commit comments