From 525d69ef54238034519e43292348bea217962cbc Mon Sep 17 00:00:00 2001 From: subtly Date: Thu, 6 Aug 2015 12:56:43 +0200 Subject: [PATCH 1/2] defs for 32-bit secp256k1 --- secp256k1/libsecp256k1-config.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/secp256k1/libsecp256k1-config.h b/secp256k1/libsecp256k1-config.h index d23fee837..ac590cee7 100644 --- a/secp256k1/libsecp256k1-config.h +++ b/secp256k1/libsecp256k1-config.h @@ -51,7 +51,9 @@ #define HAVE_UNISTD_H 1 /* Define to 1 if the system has the type `__int128'. */ +#if defined(__x86_64__) || defined(_M_X64) #define HAVE___INT128 1 +#endif /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -81,16 +83,18 @@ #define STDC_HEADERS 1 /* Define this symbol to enable x86_64 assembly optimizations */ -/* #undef USE_ASM_X86_64 */ +// #if defined(__APPLE__) || defined(__GNUC__) +// #defined USE_ASM_X86_64 1 +// #endif /* Define this symbol to use endomorphism optimization */ /* #undef USE_ENDOMORPHISM */ -/* Define this symbol to use the FIELD_10X26 implementation */ -/* #undef USE_FIELD_10X26 */ - -/* Define this symbol to use the FIELD_5X52 implementation */ +#if defined(__x86_64__) || defined(_M_X64) #define USE_FIELD_5X52 1 +#elif defined(__i386) || defined(_M_IX86) +#define USE_FIELD_10X26 1 +#endif /* Define this symbol to use the native field inverse implementation */ /* #undef USE_FIELD_INV_BUILTIN */ @@ -104,11 +108,11 @@ /* Define this symbol to use no num implementation */ /* #undef USE_NUM_NONE */ -/* Define this symbol to use the 4x64 scalar implementation */ +#if defined(__x86_64__) || defined(_M_X64) #define USE_SCALAR_4X64 1 - -/* Define this symbol to use the 8x32 scalar implementation */ -/* #undef USE_SCALAR_8X32 */ +#elif defined(__i386) || defined(_M_IX86) +#define USE_SCALAR_8X32 1 +#endif /* Define this symbol to use the native scalar inverse implementation */ /* #undef USE_SCALAR_INV_BUILTIN */ From 09c8fa4fafe01647d9ef2bcea7829950ab6d79c3 Mon Sep 17 00:00:00 2001 From: subtly Date: Thu, 6 Aug 2015 19:39:25 +0100 Subject: [PATCH 2/2] fix build --- secp256k1/libsecp256k1-config.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/secp256k1/libsecp256k1-config.h b/secp256k1/libsecp256k1-config.h index ac590cee7..0cbbc2434 100644 --- a/secp256k1/libsecp256k1-config.h +++ b/secp256k1/libsecp256k1-config.h @@ -83,9 +83,7 @@ #define STDC_HEADERS 1 /* Define this symbol to enable x86_64 assembly optimizations */ -// #if defined(__APPLE__) || defined(__GNUC__) -// #defined USE_ASM_X86_64 1 -// #endif +/* #undef USE_ASM_X86_64 */ /* Define this symbol to use endomorphism optimization */ /* #undef USE_ENDOMORPHISM */