]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
LibTomMath: Use 64-bit mode for mp_digit
authorJouni Malinen <j@w1.fi>
Sat, 9 Jun 2012 08:53:30 +0000 (11:53 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 9 Jun 2012 08:53:30 +0000 (11:53 +0300)
For 64-bit x86 builds, enable 64-bit mode to optimize bignum operations
with the internal LibTomMath version.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/tls/libtommath.c

index 7c9857f5c197f1fa1248bdbfdac014f49a4d6dd6..741b442ca912de71c50a6e9fa5fa30f70f9bd91b 100644 (file)
 
 #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