summaryrefslogtreecommitdiffstats
path: root/libtommath/tommath.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-08-29 20:25:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-08-29 20:25:53 (GMT)
commit8d57ba065e242221190542491377421544c3434f (patch)
tree62c861d1863965d739a321113db7b0307c6159cd /libtommath/tommath.h
parent897af8a8a02ac365edb53bc087b293adaaf8853a (diff)
parentd2f4a7137d403a7acf2b9cffe545c8350245ae54 (diff)
downloadtcl-8d57ba065e242221190542491377421544c3434f.zip
tcl-8d57ba065e242221190542491377421544c3434f.tar.gz
tcl-8d57ba065e242221190542491377421544c3434f.tar.bz2
libtommath 1.0.1 rc2, for test purposes only
Diffstat (limited to 'libtommath/tommath.h')
-rw-r--r--libtommath/tommath.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index e696779..61805ad 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -27,7 +27,12 @@ extern "C" {
#endif
/* detect 64-bit mode if possible */
-#if defined(__x86_64__)
+#if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) || \
+ defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || \
+ defined(__s390x__) || defined(__arch64__) || defined(__aarch64__) || \
+ defined(__sparcv9) || defined(__sparc_v9__) || defined(__sparc64__) || \
+ defined(__ia64) || defined(__ia64__) || defined(__itanium__) || defined(_M_IA64) || \
+ defined(__LP64__) || defined(_LP64) || defined(__64BIT__)
#if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
#define MP_64BIT
#endif
@@ -57,11 +62,6 @@ extern "C" {
#endif
#elif defined(MP_64BIT)
/* for GCC only on supported platforms */
-#ifndef CRYPT
- typedef unsigned long long ulong64;
- typedef signed long long long64;
-#endif
-
typedef ulong64 mp_digit;
#if defined(_WIN32)
typedef unsigned __int128 mp_word;
@@ -78,11 +78,6 @@ extern "C" {
/* this is the default case, 28-bit digits */
/* this is to make porting into LibTomCrypt easier :-) */
-#ifndef CRYPT
- typedef unsigned long long ulong64;
- typedef signed long long long64;
-#endif
-
typedef uint32_t mp_digit;
typedef ulong64 mp_word;
@@ -104,16 +99,16 @@ extern "C" {
typedef mp_digit mp_min_u32;
#endif
-/* platforms that can use a better rand function */
+/* use arc4random on platforms that support it */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
- #define MP_USE_ALT_RAND 1
+ #define MP_GEN_RANDOM() arc4random()
+ #define MP_GEN_RANDOM_MAX 0xffffffff
#endif
-/* use arc4random on platforms that support it */
-#ifdef MP_USE_ALT_RAND
- #define MP_GEN_RANDOM() arc4random()
-#else
+/* use rand() as fall-back if there's no better rand function */
+#ifndef MP_GEN_RANDOM
#define MP_GEN_RANDOM() rand()
+ #define MP_GEN_RANDOM_MAX RAND_MAX
#endif
#define MP_DIGIT_BIT DIGIT_BIT
@@ -570,6 +565,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream);
#endif
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: HEAD -> release/1.0.1, tag: v1.0.1-rc2 */
+/* git commit: e8c27ba7df0efb90708029115c94d681dfa7812f */
+/* commit time: 2017-08-29 10:48:46 +0200 */