diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-11-15 16:23:00 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-11-15 16:23:00 +0200 |
commit | ef9f52cbb39e46918c96200b09c21e931eff174f (patch) | |
tree | cb44bb767d8bdfd45c5376373f6ab6f32f351ab9 /cipher/camellia-aesni-avx2-amd64.S | |
parent | c8ad83fb605fdbf6dc0b0dbcc8aedfbd477640da (diff) | |
download | libgcrypt-ef9f52cbb39e46918c96200b09c21e931eff174f.tar.gz |
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>
Diffstat (limited to 'cipher/camellia-aesni-avx2-amd64.S')
-rw-r--r-- | cipher/camellia-aesni-avx2-amd64.S | 4 |
1 files changed, 2 insertions, 2 deletions
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 |