arcfour: more optimized version for non-i386 architectures
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 16 Oct 2013 18:23:15 +0000 (21:23 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 16 Oct 2013 18:23:15 +0000 (21:23 +0300)
commitf9371c026aad09ff48746d22c8333746c886e773
treece743834f91d1469665acad3d051ddc16ea19814
parentc89ab921ccfaefe6c4f6a724d01e0df41a1a381f
arcfour: more optimized version for non-i386 architectures

* cipher/arcfour.c (ARCFOUR_context): Reorder members.
(do_encrypt_stream) [!__i386__]: Faster implementation for non-i386.
(do_arcfour_setkey): Avoid modulo operations.
--

Patch adds faster arcfour implementation for non-i386 architectures. New code
is not activated on i386 as performance would regress. This is because i386
does not have enough registers hold new variables.

Speed up on Intel i5-4570 (x86_64): 1.56x
Speed up on ARM Cortex-A8: 1.18x

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