summaryrefslogtreecommitdiff
path: root/cipher/sm4.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2022-06-28 13:39:32 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-07-06 13:04:08 +0300
commit935e211af145c559c9147026339ceb947edb6d6a (patch)
tree9d463952afa6fe702d8985b19361f9e229f4c347 /cipher/sm4.c
parent99b7375bd6162c7c3f481ab6d0d106bfcb5b2b07 (diff)
downloadlibgcrypt-935e211af145c559c9147026339ceb947edb6d6a.tar.gz
sm4: fix use of GFNI/AVX2 accelerated key expansion
* cipher/sm4.c [USE_GFNI_AVX2] (_gcry_sm4_gfni_avx_expand_key): Remove. [USE_GFNI_AVX2] (_gcry_sm4_gfni_avx2_expand_key): New. (sm4_expand_key): Change '_gcry_sm4_gfni_avx_expand_key' to '_gcry_sm4_gfni_avx2_expand_key'. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/sm4.c')
-rw-r--r--cipher/sm4.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cipher/sm4.c b/cipher/sm4.c
index 5f8bf224..d4711603 100644
--- a/cipher/sm4.c
+++ b/cipher/sm4.c
@@ -311,9 +311,9 @@ sm4_aesni_avx2_crypt_blk1_16(const void *rk, byte *out, const byte *in,
#endif /* USE_AESNI_AVX2 */
#ifdef USE_GFNI_AVX2
-extern void _gcry_sm4_gfni_avx_expand_key(const byte *key, u32 *rk_enc,
- u32 *rk_dec, const u32 *fk,
- const u32 *ck) ASM_FUNC_ABI;
+extern void _gcry_sm4_gfni_avx2_expand_key(const byte *key, u32 *rk_enc,
+ u32 *rk_dec, const u32 *fk,
+ const u32 *ck) ASM_FUNC_ABI;
extern void _gcry_sm4_gfni_avx2_ctr_enc(const u32 *rk_enc, byte *out,
const byte *in,
@@ -516,11 +516,11 @@ sm4_expand_key (SM4_context *ctx, const byte *key)
u32 rk[4];
int i;
-#ifdef USE_GFNI_AVX
- if (ctx->use_gfni_avx)
+#ifdef USE_GFNI_AVX2
+ if (ctx->use_gfni_avx2)
{
- _gcry_sm4_gfni_avx_expand_key (key, ctx->rkey_enc, ctx->rkey_dec,
- fk, ck);
+ _gcry_sm4_gfni_avx2_expand_key (key, ctx->rkey_enc, ctx->rkey_dec,
+ fk, ck);
return;
}
#endif