mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-13 02:14:40 +08:00
improve various issues
- duplicate definition - wrong comments - redundant include statement Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
782b966666
commit
f65f71eef3
@ -68,30 +68,6 @@
|
|||||||
#define MBEDTLS_ARCH_IS_X64
|
#define MBEDTLS_ARCH_IS_X64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MBEDTLS_ARCH_IS_X86) && \
|
|
||||||
(defined(__i386__) || defined(_X86_) || \
|
|
||||||
(defined(_M_IX86) && !defined(_M_I86)))
|
|
||||||
#define MBEDTLS_ARCH_IS_X86
|
|
||||||
#endif
|
|
||||||
/* Macros for build-time platform detection */
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_ARCH_IS_ARM64) && \
|
|
||||||
(defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC))
|
|
||||||
#define MBEDTLS_ARCH_IS_ARM64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_ARCH_IS_ARM32) && \
|
|
||||||
(defined(__arm__) || defined(_M_ARM) || \
|
|
||||||
defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__))
|
|
||||||
#define MBEDTLS_ARCH_IS_ARM32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_ARCH_IS_X64) && \
|
|
||||||
(defined(__amd64__) || defined(__x86_64__) || \
|
|
||||||
((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)))
|
|
||||||
#define MBEDTLS_ARCH_IS_X64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_ARCH_IS_X86) && \
|
#if !defined(MBEDTLS_ARCH_IS_X86) && \
|
||||||
(defined(__i386__) || defined(_X86_) || \
|
(defined(__i386__) || defined(_X86_) || \
|
||||||
(defined(_M_IX86) && !defined(_M_I86)))
|
(defined(_M_IX86) && !defined(_M_I86)))
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#include "mbedtls/aes.h"
|
#include "mbedtls/aes.h"
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_ARCH_IS_ARM64)
|
#if defined(MBEDTLS_AESCE_C) && defined(MBEDTLS_ARCH_IS_ARM64)
|
||||||
|
|
||||||
|
@ -32,10 +32,6 @@
|
|||||||
#define MBEDTLS_AESNI_AES 0x02000000u
|
#define MBEDTLS_AESNI_AES 0x02000000u
|
||||||
#define MBEDTLS_AESNI_CLMUL 0x00000002u
|
#define MBEDTLS_AESNI_CLMUL 0x00000002u
|
||||||
|
|
||||||
/* Can we do AESNI with inline assembly?
|
|
||||||
* (Only implemented with gas syntax, only for 64-bit.)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_AESNI_C) && \
|
#if defined(MBEDTLS_AESNI_C) && \
|
||||||
(defined(MBEDTLS_ARCH_IS_X64) || defined(MBEDTLS_ARCH_IS_X86))
|
(defined(MBEDTLS_ARCH_IS_X64) || defined(MBEDTLS_ARCH_IS_X86))
|
||||||
|
|
||||||
@ -65,6 +61,9 @@
|
|||||||
#define MBEDTLS_AESNI_HAVE_CODE 2 // via intrinsics
|
#define MBEDTLS_AESNI_HAVE_CODE 2 // via intrinsics
|
||||||
#elif defined(MBEDTLS_HAVE_ASM) && \
|
#elif defined(MBEDTLS_HAVE_ASM) && \
|
||||||
defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X64)
|
defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X64)
|
||||||
|
/* Can we do AESNI with inline assembly?
|
||||||
|
* (Only implemented with gas syntax, only for 64-bit.)
|
||||||
|
*/
|
||||||
#define MBEDTLS_AESNI_HAVE_CODE 1 // via assembly
|
#define MBEDTLS_AESNI_HAVE_CODE 1 // via assembly
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# error "Must use `-mpclmul -msse2 -maes` for MBEDTLS_AESNI_C"
|
# error "Must use `-mpclmul -msse2 -maes` for MBEDTLS_AESNI_C"
|
||||||
|
@ -38,9 +38,14 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some versions of ASan result in errors about not enough registers */
|
/*
|
||||||
#if defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X86) && \
|
* - `padlock` is implements with GNUC assembly for x86 target.
|
||||||
defined(MBEDTLS_HAVE_ASM) && !defined(MBEDTLS_HAVE_ASAN)
|
* - Some versions of ASan result in errors about not enough registers.
|
||||||
|
*/
|
||||||
|
#if defined(MBEDTLS_PADLOCK_C) && \
|
||||||
|
defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X86) && \
|
||||||
|
defined(MBEDTLS_HAVE_ASM) && \
|
||||||
|
!defined(MBEDTLS_HAVE_ASAN)
|
||||||
|
|
||||||
#define MBEDTLS_VIA_PADLOCK_HAVE_CODE
|
#define MBEDTLS_VIA_PADLOCK_HAVE_CODE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user