summaryrefslogtreecommitdiffstats
path: root/libtommath/tommath.h
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2005-09-26 18:27:13 (GMT)
committerkennykb <kennykb@noemail.net>2005-09-26 18:27:13 (GMT)
commitbcbefb3da2a12c1c12d709c79d7c2be2e635bd80 (patch)
tree082d7efac9345062c01fb1cde28a85d0b39155c5 /libtommath/tommath.h
parentf2fd37bb8cf8647355cd1df884871fbad9ca33e2 (diff)
downloadtcl-bcbefb3da2a12c1c12d709c79d7c2be2e635bd80.zip
tcl-bcbefb3da2a12c1c12d709c79d7c2be2e635bd80.tar.gz
tcl-bcbefb3da2a12c1c12d709c79d7c2be2e635bd80.tar.bz2
merge tommath 0.36 changes into HEAD
FossilOrigin-Name: ff8642110696b532f20be9b958a62d0055add17d
Diffstat (limited to 'libtommath/tommath.h')
-rw-r--r--libtommath/tommath.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index ce8591f..bae09ce 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -23,10 +23,13 @@
#include <tommath_class.h>
-#undef MIN
-#define MIN(x,y) ((x)<(y)?(x):(y))
-#undef MAX
-#define MAX(x,y) ((x)>(y)?(x):(y))
+#ifndef MIN
+ #define MIN(x,y) ((x)<(y)?(x):(y))
+#endif
+
+#ifndef MAX
+ #define MAX(x,y) ((x)>(y)?(x):(y))
+#endif
#ifdef __cplusplus
extern "C" {
@@ -112,7 +115,7 @@ extern "C" {
#else
/* prototypes for our heap functions */
extern void *XMALLOC(size_t n);
- extern void *REALLOC(void *p, size_t n);
+ extern void *XREALLOC(void *p, size_t n);
extern void *XCALLOC(size_t n, size_t s);
extern void XFREE(void *p);
#endif
@@ -147,7 +150,6 @@ extern "C" {
/* Primality generation flags */
#define LTM_PRIME_BBS 0x0001 /* BBS style prime */
#define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
-#define LTM_PRIME_2MSB_OFF 0x0004 /* force 2nd MSB to 0 */
#define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
typedef int mp_err;
@@ -164,7 +166,7 @@ extern int KARATSUBA_MUL_CUTOFF,
/* default precision */
#ifndef MP_PREC
#ifndef MP_LOW_MEM
- #define MP_PREC 64 /* default digits of precision */
+ #define MP_PREC 32 /* default digits of precision */
#else
#define MP_PREC 8 /* default digits of precision */
#endif
@@ -518,13 +520,13 @@ int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback
int mp_count_bits(mp_int *a);
int mp_unsigned_bin_size(mp_int *a);
-int mp_read_unsigned_bin(mp_int *a, unsigned char *b, int c);
+int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c);
int mp_to_unsigned_bin(mp_int *a, unsigned char *b);
int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen);
int mp_signed_bin_size(mp_int *a);
-int mp_read_signed_bin(mp_int *a, unsigned char *b, int c);
-int mp_to_signed_bin(mp_int *a, unsigned char *b);
+int mp_read_signed_bin(mp_int *a, const unsigned char *b, int c);
+int mp_to_signed_bin(mp_int *a, unsigned char *b);
int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen);
int mp_read_radix(mp_int *a, const char *str, int radix);
@@ -576,3 +578,7 @@ extern const char *mp_s_rmap;
#endif
+
+/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath.h,v $ */
+/* $Revision: 1.3 $ */
+/* $Date: 2005/09/26 18:27:14 $ */