Camellia: Add AVX/AES-NI key setup
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 15 Nov 2013 14:23:00 +0000 (16:23 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 15 Nov 2013 14:23:00 +0000 (16:23 +0200)
commitef9f52cbb39e46918c96200b09c21e931eff174f
treecb44bb767d8bdfd45c5376373f6ab6f32f351ab9
parentc8ad83fb605fdbf6dc0b0dbcc8aedfbd477640da
Camellia: Add AVX/AES-NI key setup

* cipher/camellia-aesni-avx-amd64.S (key_bitlength, key_table): New
order of fields in ctx.
(camellia_f, vec_rol128, vec_ror128): New macros.
(__camellia_avx_setup128, __camellia_avx_setup256)
(_gcry_camellia_aesni_avx_keygen): New functions.
* cipher/camellia-aesni-avx2-amd64.S (key_bitlength, key_table): New
order of fields in ctx.
* cipher/camellia-arm.S (CAMELLIA_TABLE_BYTE_LEN, key_length): Remove
unused macros.
* cipher/camellia-glue.c (CAMELLIA_context): Move keytable to head for
better alignment; Make 'use_aesni_avx' and 'use_aesni_avx2' bitfield
members.
[USE_AESNI_AVX] (_gcry_camellia_aesni_avx_keygen): New prototype.
(camellia_setkey) [USE_AESNI_AVX || USE_AESNI_AVX2]: Read hw features
to variable 'hwf' and match features from it.
(camellia_setkey) [USE_AESNI_AVX]: Use AES-NI/AVX key setup if
available.
--

Use AVX/AES-NI for key-setup for small speed-up.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/camellia-aesni-avx-amd64.S
cipher/camellia-aesni-avx2-amd64.S
cipher/camellia-arm.S
cipher/camellia-glue.c