summaryrefslogtreecommitdiffhomepage
path: root/libtommath/tommath.h
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/tommath.h')
-rw-r--r--libtommath/tommath.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index bcb9d86..1ead3d0 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -10,7 +10,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org
+ * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
*/
#ifndef BN_H_
#define BN_H_
@@ -21,12 +21,15 @@
#include <ctype.h>
#include <limits.h>
-#include <tommath_class.h>
+#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: /cvs/libtom/libtommath/tommath.h,v $ */
+/* $Revision: 1.8 $ */
+/* $Date: 2006/03/31 14:18:44 $ */