Speed up Stribog
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 1 Oct 2013 18:47:53 +0000 (21:47 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 6 Nov 2013 17:23:00 +0000 (19:23 +0200)
commita48d07ccadee4cb8b666a9a4ba2f00129bad5b2f
treeb7e7a05878e692864b554b0f7c1adc58d0c7c1e7
parent3b5058b58a183fa23ecf3ef819e2ae6ac64c0216
Speed up Stribog

* cipher/stribog.c (STRIBOG_TABLES): Remove.
(Pi): Remove.
[!STRIBOG_TABLES] (A, strido): Remove.
(stribog_table): New table pre-reordered with Pi values.
(strido): Rewrite for new table.
(LPSX): Rewrite for new table.
(xor): Remove.
(g): Small tweaks.
--

Patch optimizes the table-lookup implementation a bit. Patch also removes
the unused non-table implementation from source.

On Intel Core i5-4570 (amd64, 3.2Ghz):

After:
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 STRIBOG256     |      9.22 ns/B     103.4 MiB/s     29.53 c/B
 STRIBOG512     |      9.23 ns/B     103.4 MiB/s     29.53 c/B

Before:
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 STRIBOG256     |     30.17 ns/B     31.61 MiB/s     96.56 c/B
 STRIBOG512     |     30.20 ns/B     31.57 MiB/s     96.68 c/B

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/stribog.c