rijndael-aesni: interleave last CTR encryption round with xoring
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 1 Dec 2018 10:21:14 +0000 (12:21 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 1 Dec 2018 10:21:14 +0000 (12:21 +0200)
commit66d2b7fc17258f1424f4ca4adb1096e48b818bd0
tree76a35182d7dbd8bd67935e099fdc1018fdf3a021
parent168668228c7c49e70612cb4d602d6d603a2add2c
rijndael-aesni: interleave last CTR encryption round with xoring

* cipher/rijndael-aesni.c (do_aesni_ctr_8): Interleave aesenclast
with input xoring.
--

Structure of 'aesenclast' instruction allows reordering last
encryption round and xoring of input block for small ~0.5%
improvement in performance.

Intel i7-4790K @ 4.0 Ghz:
 AES            |  nanosecs/byte   mebibytes/sec   cycles/byte
        CTR enc |     0.159 ns/B      6002 MiB/s     0.636 c/B
        CTR dec |     0.159 ns/B      6001 MiB/s     0.636 c/B

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