diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-28 20:59:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-28 20:59:03 (GMT) |
commit | abf9722f425fcd4a8327dddaf5c5ccf08b1d30d6 (patch) | |
tree | f7fcce47ca0f81f1eb0ec24efb9e34025ae158eb /libtommath/tommath.h | |
parent | d74f47cb2ad9e4fa4b038c1a2205f3e8becc2af0 (diff) | |
download | tcl-abf9722f425fcd4a8327dddaf5c5ccf08b1d30d6.zip tcl-abf9722f425fcd4a8327dddaf5c5ccf08b1d30d6.tar.gz tcl-abf9722f425fcd4a8327dddaf5c5ccf08b1d30d6.tar.bz2 |
Turn KARATSUBA_MUL_CUTOFF (insize libtommath) et al into a #define in stead of exported int symbols.
Diffstat (limited to 'libtommath/tommath.h')
-rw-r--r-- | libtommath/tommath.h | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/libtommath/tommath.h b/libtommath/tommath.h index 00c8b35..85814e7 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -23,7 +23,7 @@ extern "C" { #endif /* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */ -#if defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__) +#if defined(_WIN32) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__) # define MP_32BIT #endif @@ -89,17 +89,7 @@ typedef unsigned long long mp_word; # endif #endif -/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */ -#ifndef DIGIT_BIT -# define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */ -typedef unsigned long mp_min_u32; -#else -typedef mp_digit mp_min_u32; -#endif - -#define MP_DIGIT_BIT DIGIT_BIT #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1)) -#define MP_DIGIT_MAX MP_MASK /* equalities */ #define MP_LT -1 /* less than */ @@ -125,12 +115,6 @@ typedef mp_digit mp_min_u32; typedef int mp_err; -/* you'll have to tune these... */ -extern int KARATSUBA_MUL_CUTOFF, - KARATSUBA_SQR_CUTOFF, - TOOM_MUL_CUTOFF, - TOOM_SQR_CUTOFF; - /* define this to use lower memory usage routines (exptmods mostly) */ /* #define MP_LOW_MEM */ @@ -143,9 +127,6 @@ extern int KARATSUBA_MUL_CUTOFF, # endif #endif -/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */ -#define MP_WARRAY (1u << (((sizeof(mp_word) * CHAR_BIT) - (2 * DIGIT_BIT)) + 1)) - /* the infamous mp_int structure */ typedef struct { int used, alloc, sign; @@ -156,10 +137,6 @@ typedef struct { typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat); -#define USED(m) ((m)->used) -#define DIGIT(m, k) ((m)->dp[(k)]) -#define SIGN(m) ((m)->sign) - /* error code to char* string */ const char *mp_error_to_string(int code); |