|
17 | 17 |
|
18 | 18 | #if defined(__x86_64__) || defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) |
19 | 19 |
|
| 20 | +#if ( (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 10)) || \ |
| 21 | + (defined(__clang__) && (__clang_major__ >= 11)) ) |
| 22 | + |
20 | 23 | #include <openssl/modes.h> |
21 | 24 |
|
| 25 | +/* Function prototypes */ |
| 26 | +void ossl_aes_ctr_vaes(const unsigned char *in, unsigned char *out, |
| 27 | + size_t length, const AES_KEY *key, |
| 28 | + unsigned char *counter, |
| 29 | + unsigned char *ecount_buf, unsigned int *num); |
| 30 | +int ossl_aes_ctr_vaes_eligible(void); |
| 31 | + |
22 | 32 | /* Forward declaration — defined in aesni-x86_64.pl assembly */ |
23 | 33 | void aesni_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); |
24 | 34 |
|
25 | 35 | /* Portable compiler abstractions for inlining and ISA target selection */ |
26 | 36 | #if defined(__GNUC__) || defined(__clang__) /* GCC, Clang, and clang-cl */ |
27 | 37 | # define OSSL_FUNC_ALWAYS_INLINE __attribute__((always_inline)) |
28 | 38 | # define OSSL_FUNC_NOINLINE __attribute__((noinline)) |
29 | | -# pragma GCC target("avx512f,avx512dq,avx512bw,vaes,aes") |
| 39 | +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 10) |
| 40 | +# pragma GCC target("avx512f,avx512dq,avx512bw,vaes,aes") |
| 41 | +# endif |
30 | 42 | /* GCC/Clang require this pragma to make AVX-512/VAES intrinsics available. |
31 | 43 | * MSVC does not need it: all intrinsics are always declared in <immintrin.h>. */ |
32 | 44 | #elif defined(_MSC_VER) /* MSVC */ |
@@ -405,4 +417,5 @@ int ossl_aes_ctr_vaes_eligible(void) |
405 | 417 | #undef OSSL_FUNC_ALWAYS_INLINE |
406 | 418 | #undef OSSL_FUNC_NOINLINE |
407 | 419 |
|
| 420 | +#endif /* compiler version guard */ |
408 | 421 | #endif /* __x86_64__ || _M_AMD64 */ |
0 commit comments