From: Jouni Malinen Date: Sat, 9 Jun 2012 08:53:30 +0000 (+0300) Subject: LibTomMath: Use 64-bit mode for mp_digit X-Git-Tag: hostap_2_0~639 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e22ba3e3908c8d9027594397d4a3e811a0f43c06;p=thirdparty%2Fhostap.git LibTomMath: Use 64-bit mode for mp_digit For 64-bit x86 builds, enable 64-bit mode to optimize bignum operations with the internal LibTomMath version. Signed-hostap: Jouni Malinen --- diff --git a/src/tls/libtommath.c b/src/tls/libtommath.c index 7c9857f5c..741b442ca 100644 --- a/src/tls/libtommath.c +++ b/src/tls/libtommath.c @@ -66,11 +66,19 @@ #define OPT_CAST(x) +#ifdef __x86_64__ +typedef unsigned long mp_digit; +typedef unsigned long mp_word __attribute__((mode(TI))); + +#define DIGIT_BIT 60 +#define MP_64BIT +#else typedef unsigned long mp_digit; typedef u64 mp_word; #define DIGIT_BIT 28 #define MP_28BIT +#endif #define XMALLOC os_malloc