diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-09-01 16:50:55 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-09-01 16:50:55 +0300 |
commit | 8b735cb563dff7aafbf8a970972522b5621e665c (patch) | |
tree | b4efa5afde49d5ca9d0659b8f98165f6104874f5 /cipher/camellia-glue.c | |
parent | d12828cd821a4b4428eae19de5aee02cf536e536 (diff) | |
download | libgcrypt-8b735cb563dff7aafbf8a970972522b5621e665c.tar.gz |
camellia-aesni-avx-amd64: Move register clearing to assembly functions
* cipher/camellia-aesni-avx-amd64.S (_gcry_camellia_aesni_avx_ctr_enc)
(_gcry_camellia_aesni_avx_cbc_dec)
(_gcry_camellia_aesni_avx_cfb_dec): Add 'vzeroupper' at head and
'vzeroall' at tail.
* cipher/camellia-glue.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec)
(_gcry_serpent_avx2_cfb_dec) [USE_AESNI_AVX]: Remove register clearing.
--
Patch moves register clearing with 'vzeroall' to assembly functions and
adds missing 'vzeroupper' instructions at head of assembly functions.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/camellia-glue.c')
-rw-r--r-- | cipher/camellia-glue.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/cipher/camellia-glue.c b/cipher/camellia-glue.c index 6e2319d5..7d8a4cdc 100644 --- a/cipher/camellia-glue.c +++ b/cipher/camellia-glue.c @@ -344,9 +344,6 @@ _gcry_camellia_ctr_enc(void *context, unsigned char *ctr, if (did_use_aesni_avx) { - /* clear AVX registers */ - asm volatile ("vzeroall;\n":::); - if (burn_stack_depth < 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *)) burn_stack_depth = 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *); } @@ -440,9 +437,6 @@ _gcry_camellia_cbc_dec(void *context, unsigned char *iv, if (did_use_aesni_avx) { - /* clear AVX registers */ - asm volatile ("vzeroall;\n":::); - if (burn_stack_depth < 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *)) burn_stack_depth = 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *); } @@ -531,9 +525,6 @@ _gcry_camellia_cfb_dec(void *context, unsigned char *iv, if (did_use_aesni_avx) { - /* clear AVX registers */ - asm volatile ("vzeroall;\n":::); - if (burn_stack_depth < 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *)) burn_stack_depth = 16 * CAMELLIA_BLOCK_SIZE + 2 * sizeof(void *); } |