diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-11-29 17:31:03 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2012-11-29 19:03:24 +0100 |
commit | 9ee9e25f519696d509b1a5c1cc04ab0121e98a51 (patch) | |
tree | 8f98f5846582efd09259c86df8eaabfa3c647cf4 /cipher/cipher-ctr.c | |
parent | 6765e0a8618000d3dc7bda035163e0708c43791b (diff) | |
download | libgcrypt-9ee9e25f519696d509b1a5c1cc04ab0121e98a51.tar.gz |
Optimize AES-NI CTR mode.
* cipher/rijndael.c [USE_AESNI] (do_aesni_ctr, do_aesni_ctr_4): Make
handling of 64-bit overflow and carry conditional. Avoid generic to
vector register passing of value '1'. Generate and use '-1' instead.
--
We only need to handle 64-bit carry in few special cases, that happen very
rarely. So move carry handling to slow-path and only detect need for carry
handling on fast-path. Also avoid moving '1' from generic register to vector
register, as that might be slow on some CPUs. Instead generate '-1' with
SSE2 instructions and use subtraction instead of addition to increase IV.
Overall this gives ~8% improvement in speed for AES CTR mode on Intel
Sandy-Bridge.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Diffstat (limited to 'cipher/cipher-ctr.c')
0 files changed, 0 insertions, 0 deletions