From ef9f52cbb39e46918c96200b09c21e931eff174f Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Fri, 15 Nov 2013 16:23:00 +0200 Subject: 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 --- cipher/camellia-aesni-avx2-amd64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cipher/camellia-aesni-avx2-amd64.S') diff --git a/cipher/camellia-aesni-avx2-amd64.S b/cipher/camellia-aesni-avx2-amd64.S index 78ef2d62..65c923ea 100644 --- a/cipher/camellia-aesni-avx2-amd64.S +++ b/cipher/camellia-aesni-avx2-amd64.S @@ -32,8 +32,8 @@ #define CAMELLIA_TABLE_BYTE_LEN 272 /* struct CAMELLIA_context: */ -#define key_bitlength 0 -#define key_table 4 +#define key_table 0 +#define key_bitlength CAMELLIA_TABLE_BYTE_LEN /* register macros */ #define CTX %rdi -- cgit v1.2.1