diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2018-11-09 13:22:05 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2018-11-14 15:32:01 +0100 |
commit | b848bb238264e0b2b23ccb5543a9588e02575ddd (patch) | |
tree | 8cfe9eeb9504be350b14e3df2d56588724c63bd9 /core/lib | |
parent | e789ada3f9c0e021452d6d933b284388a1e0f88f (diff) |
LTC: drop LTC_NO_ASM and configure
Drops LTC_NO_ASM and configures endian and word size accordingly, that
is, little endian and 32-bit or 64-bit depending on arm architecture.
Defines ulong32 and ulong64 based on uint32_t and uint64_t to make
sure that the types are always defined correctly.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/lib')
-rw-r--r-- | core/lib/libtomcrypt/include/tomcrypt_custom.h | 17 | ||||
-rw-r--r-- | core/lib/libtomcrypt/include/tomcrypt_macros.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/lib/libtomcrypt/include/tomcrypt_custom.h b/core/lib/libtomcrypt/include/tomcrypt_custom.h index 2fbb7a11..d4f8de1a 100644 --- a/core/lib/libtomcrypt/include/tomcrypt_custom.h +++ b/core/lib/libtomcrypt/include/tomcrypt_custom.h @@ -275,7 +275,7 @@ #define LTC_NO_FILE /* disable all forms of ASM */ -#define LTC_NO_ASM +/* #define LTC_NO_ASM */ /* disable FAST mode */ /* #define LTC_NO_FAST */ @@ -535,6 +535,21 @@ /* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and LTC_RC4 work (see the code) */ /* #define LTC_VALGRIND */ +#if defined(ARM32) || defined(ARM64) +#define ENDIAN_LITTLE +#endif +#ifdef ARM32 +#define ENDIAN_32BITWORD +#endif +#ifdef ARM64 +#define ENDIAN_64BITWORD +#endif + +#define LTC_ULONGXX_DEFINED +typedef uint32_t ulong32; +typedef uint64_t ulong64; +#define CONST64(x) UINT64_C(x) + #endif diff --git a/core/lib/libtomcrypt/include/tomcrypt_macros.h b/core/lib/libtomcrypt/include/tomcrypt_macros.h index 895c12e6..8b94b80a 100644 --- a/core/lib/libtomcrypt/include/tomcrypt_macros.h +++ b/core/lib/libtomcrypt/include/tomcrypt_macros.h @@ -29,6 +29,7 @@ #ifndef TOMCRYPT_MACROS_H_ #define TOMCRYPT_MACROS_H_ +#ifndef LTC_ULONGXX_DEFINED /* fix for MSVC ...evil! */ #ifdef _MSC_VER #define CONST64(n) n ## ui64 @@ -47,6 +48,7 @@ #else typedef unsigned long ulong32; #endif +#endif #ifdef ENDIAN_64BITWORD typedef ulong64 ltc_mp_digit; |