Reduce code size for Twofish key-setup and remove key dependend branch
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 13 Jul 2015 13:16:13 +0000 (16:16 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Mon, 27 Jul 2015 08:47:19 +0000 (11:47 +0300)
commitb4b1d872ba651bc44761b35d245b1a519a33f515
treed1243e1f719179ba5ad85f38858c297e5fa07cd8
parente950052bc6f5ff11a7c23091ff3f6b5cc431e875
Reduce code size for Twofish key-setup and remove key dependend branch

* cipher/twofish.c (poly_to_exp): Increase size by one, change type
from byte to u16 and insert '492' to index 0.
(exp_to_poly): Increase size by 256, let new cells have zero value.
(CALC_S): Execute unconditionally with help of modified tables.
(do_twofish_setkey): Change type for 'tmp' to 'unsigned int'; Un-unroll
CALC_K256 and CALC_K phases to reduce generated object size.
--

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