enable runtime detection when padlock enabled and plain c disabled

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-08-16 16:08:42 +08:00
parent cc068ae631
commit c628486cd9
2 changed files with 4 additions and 2 deletions

View file

@ -39,7 +39,8 @@
#include <immintrin.h>
#endif
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY) || \
(defined(MBEDTLS_HAVE_X86) && defined(MBEDTLS_PADLOCK_C))
/*
* AES-NI support detection routine
*/

View file

@ -97,7 +97,8 @@ extern "C" {
*
* \return 1 if CPU has support for the feature, 0 otherwise
*/
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
#if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY) || \
(defined(MBEDTLS_HAVE_X86) && defined(MBEDTLS_PADLOCK_C))
int mbedtls_aesni_has_support(unsigned int what);
#else
#define mbedtls_aesni_has_support(what) 1