diff --git a/cbits/aes/x86ni.c b/cbits/aes/x86ni.c index 590a897..f51b32d 100644 --- a/cbits/aes/x86ni.c +++ b/cbits/aes/x86ni.c @@ -30,6 +30,10 @@ #ifdef WITH_AESNI +#pragma GCC push_options +#pragma GCC target("ssse3", "aes") +#pragma clang attribute push (__attribute__((target("ssse3,aes"))), apply_to=function) + #include #include #include @@ -400,4 +404,7 @@ static inline __m128i ghash_add(__m128i tag, const table_4bit htable, __m128i m) #endif +#pragma clang attribute pop +#pragma GCC pop_options + #endif diff --git a/cryptonite.cabal b/cryptonite.cabal index 68cb78f..d0c51db 100644 --- a/cryptonite.cabal +++ b/cryptonite.cabal @@ -336,7 +336,7 @@ Library c-sources: cbits/cryptonite_rdrand.c if flag(support_aesni) && (os(linux) || os(freebsd) || os(osx)) && (arch(i386) || arch(x86_64)) - CC-options: -mssse3 -maes -DWITH_AESNI + CC-options: -DWITH_AESNI if flag(support_pclmuldq) CC-options: -msse4.1 -mpclmul -DWITH_PCLMUL C-sources: cbits/aes/x86ni.c