mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-21 19:20:56 +00:00
replace arm64 macro and aesce enable flag
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
926221a26e
commit
72fd0bdc71
@ -34,7 +34,7 @@
|
||||
#include "mbedtls/platform_util.h"
|
||||
#include "mbedtls/error.h"
|
||||
|
||||
#if defined(__aarch64__)
|
||||
#if defined(MBEDTLS_ARCH_IS_ARM64)
|
||||
#if !defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
|
||||
#error "MBEDTLS_AES_USE_HARDWARE_ONLY defined, but not all prerequisites"
|
||||
#endif
|
||||
@ -652,7 +652,7 @@ int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
return mbedtls_aesce_setkey_enc((unsigned char *) RK, key, keybits);
|
||||
}
|
||||
@ -764,7 +764,7 @@ int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
mbedtls_aesce_inverse_key(
|
||||
(unsigned char *) RK,
|
||||
@ -1091,7 +1091,7 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
return mbedtls_aesce_crypt_ecb(ctx, mode, input, output);
|
||||
}
|
||||
@ -1910,7 +1910,7 @@ int mbedtls_aes_self_test(int verbose)
|
||||
mbedtls_printf(" AES note: using VIA Padlock.\n");
|
||||
} else
|
||||
#endif
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
mbedtls_printf(" AES note: using AESCE.\n");
|
||||
} else
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include "aesce.h"
|
||||
|
||||
#if defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_ARCH_IS_ARM64)
|
||||
|
||||
/* Compiler version checks. */
|
||||
#if defined(__clang__)
|
||||
@ -510,6 +510,6 @@ void mbedtls_aesce_gcm_mult(unsigned char c[16],
|
||||
#undef MBEDTLS_POP_TARGET_PRAGMA
|
||||
#endif
|
||||
|
||||
#endif /* MBEDTLS_HAVE_ARM64 */
|
||||
#endif /* MBEDTLS_ARCH_IS_ARM64 */
|
||||
|
||||
#endif /* MBEDTLS_AESCE_C */
|
||||
|
@ -30,13 +30,11 @@
|
||||
|
||||
#include "mbedtls/aes.h"
|
||||
|
||||
#if !defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
|
||||
#define MBEDTLS_HAVE_ARM64
|
||||
#endif
|
||||
#endif
|
||||
#include "common.h"
|
||||
|
||||
#if defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_ARCH_IS_ARM64)
|
||||
|
||||
#define MBEDTLS_AESCE_HAVE_CODE
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -131,6 +129,6 @@ int mbedtls_aesce_setkey_enc(unsigned char *rk,
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MBEDTLS_HAVE_ARM64 */
|
||||
#endif /* MBEDTLS_AESCE_C && MBEDTLS_ARCH_IS_ARM64 */
|
||||
|
||||
#endif /* MBEDTLS_AESCE_H */
|
||||
|
@ -97,7 +97,7 @@ static int gcm_gen_table(mbedtls_gcm_context *ctx)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
return 0;
|
||||
}
|
||||
@ -208,7 +208,7 @@ static void gcm_mult(mbedtls_gcm_context *ctx, const unsigned char x[16],
|
||||
}
|
||||
#endif /* MBEDTLS_AESNI_HAVE_CODE */
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
unsigned char h[16];
|
||||
|
||||
@ -885,7 +885,7 @@ int mbedtls_gcm_self_test(int verbose)
|
||||
} else
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_HAVE_ARM64)
|
||||
#if defined(MBEDTLS_AESCE_HAVE_CODE)
|
||||
if (MBEDTLS_AESCE_HAS_SUPPORT()) {
|
||||
mbedtls_printf(" GCM note: using AESCE.\n");
|
||||
} else
|
||||
|
Loading…
x
Reference in New Issue
Block a user