Improve performance of Tiger hash algorithms
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 1 Nov 2015 18:44:09 +0000 (20:44 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 1 Nov 2015 19:50:09 +0000 (21:50 +0200)
commit89fa74d6b3e58cd4fcd6e0939a35e46cbaca2ea0
treea6ad8d40c9a94a634564c4ca3cf90f76b52b84b1
parenta1cc7bb15473a2419b24ecac765ae0ce5989a13b
Improve performance of Tiger hash algorithms

* cipher/tiger.c (tiger_round, pass, key_schedule): Convert functions
to macros.
(transform_blk): Pass variable names instead of pointers to 'pass'.
--

Benchmark results on Intel Haswell @ 3.2 Ghz:

Before:
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 TIGER          |      3.25 ns/B     293.5 MiB/s     10.40 c/B

After (1.75x faster):
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 TIGER          |      1.85 ns/B     515.3 MiB/s      5.92 c/B

Benchmark results on Cortex-A8 @ 1008 Mhz:

Before:
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 TIGER          |     63.42 ns/B     15.04 MiB/s     63.93 c/B

After (1.26x faster):
                |  nanosecs/byte   mebibytes/sec   cycles/byte
 TIGER          |     49.99 ns/B     19.08 MiB/s     50.39 c/B

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