mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
Improve ILP32 detection
This should fix https://github.com/DCIT/perl-CryptX/issues/117 Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
parent
b4d41d53bb
commit
cda7d42647
3 changed files with 8 additions and 6 deletions
|
|
@ -91,9 +91,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
|
|||
#define ENDIAN_LITTLE
|
||||
#define ENDIAN_64BITWORD
|
||||
#define LTC_FAST
|
||||
#if defined(_ILP32) || defined(__ILP32__)
|
||||
#define ENDIAN_64BITWORD_X32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* detect PPC32 */
|
||||
|
|
@ -178,6 +175,11 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
|
|||
#define LTC_FAST
|
||||
#endif
|
||||
|
||||
/* Detect ILP32, commonly known as x32 on Linux and also possible on AIX */
|
||||
#if defined(_ILP32) || defined(__ILP32__)
|
||||
#define ENDIAN_64BITWORD_ILP32
|
||||
#endif
|
||||
|
||||
/* endianness fallback */
|
||||
#if !defined(ENDIAN_BIG) && !defined(ENDIAN_LITTLE)
|
||||
#if defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN || \
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
#define LTC_PAD_MASK (0xF000U)
|
||||
|
||||
/* only real 64bit, not x32 */
|
||||
#if defined(ENDIAN_64BITWORD) && !defined(ENDIAN_64BITWORD_X32)
|
||||
/* only real 64bit, not ILP32 */
|
||||
#if defined(ENDIAN_64BITWORD) && !defined(ENDIAN_64BITWORD_ILP32)
|
||||
#define CONSTPTR(n) CONST64(n)
|
||||
#else
|
||||
#define CONSTPTR(n) n ## uL
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ int multi_test(void)
|
|||
|
||||
/* HASH testing */
|
||||
len = sizeof(buf[0]);
|
||||
#if defined(ENDIAN_32BITWORD) || defined(_WIN32) || defined(ENDIAN_64BITWORD_X32)
|
||||
#if defined(ENDIAN_32BITWORD) || defined(_WIN32) || defined(ENDIAN_64BITWORD_ILP32)
|
||||
len2 = 0x80000000UL;
|
||||
#else
|
||||
/* Check against the max. input limit of SHA-1 as of RFC8017 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue