Skip to content

Commit

Permalink
Require/enable AVX for AES256-GCM
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Aug 5, 2023
1 parent 1686b52 commit 4388ef3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libsodium/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ endif

libaesni_la_LDFLAGS = $(libsodium_la_LDFLAGS)
libaesni_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \
@CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@
@CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AVX@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@
libaesni_la_SOURCES = \
crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c

Expand Down
2 changes: 1 addition & 1 deletion src/libsodium/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ librdrand_la_SOURCES = \

libaesni_la_LDFLAGS = $(libsodium_la_LDFLAGS)
libaesni_la_CPPFLAGS = $(libsodium_la_CPPFLAGS) \
@CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@
@CFLAGS_SSE2@ @CFLAGS_SSSE3@ @CFLAGS_AVX@ @CFLAGS_AESNI@ @CFLAGS_PCLMUL@

libaesni_la_SOURCES = \
crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
#if defined(HAVE_TMMINTRIN_H) && defined(HAVE_WMMINTRIN_H)

#ifdef __GNUC__
#pragma GCC target("ssse3")
#pragma GCC target("aes")
#pragma GCC target("pclmul")
#pragma GCC target("aes,pclmul,avx")
#endif

#if !defined(_MSC_VER) || _MSC_VER < 1800
Expand Down Expand Up @@ -996,7 +994,7 @@ crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, unsi
int
crypto_aead_aes256gcm_is_available(void)
{
return sodium_runtime_has_pclmul() & sodium_runtime_has_aesni();
return sodium_runtime_has_pclmul() & sodium_runtime_has_aesni() & sodium_runtime_has_avx();
}

#else
Expand Down

0 comments on commit 4388ef3

Please sign in to comment.