deprecate ltm_prime_callback
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/bn_mp_prime_random_ex.c b/bn_mp_prime_random_ex.c
index 815f0d2..360a091 100644
--- a/bn_mp_prime_random_ex.c
+++ b/bn_mp_prime_random_ex.c
@@ -18,7 +18,7 @@
*/
/* This is possibly the mother of all prime generation functions, muahahahahaha! */
-int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat)
+int mp_prime_random_ex(mp_int *a, int t, int size, int flags, mp_prime_callback cb, void *dat)
{
unsigned char *tmp, maskAND, maskOR_msb, maskOR_lsb;
int res, err, bsize, maskOR_msb_offset;
diff --git a/tommath.h b/tommath.h
index bdf1213..ffd1a46 100644
--- a/tommath.h
+++ b/tommath.h
@@ -7,7 +7,7 @@
#include <stdint.h>
#include <limits.h>
-#ifndef LTM_NO_FILE
+#ifdef LTM_NO_FILE
# warning LTM_NO_FILE has been deprecated, use MP_NO_FILE.
# define MP_NO_FILE
#endif
@@ -153,15 +153,6 @@ TOOM_SQR_CUTOFF;
# define MP_NULL_TERMINATED
#endif
-/* the infamous mp_int structure */
-typedef struct {
- int used, alloc, sign;
- mp_digit *dp;
-} mp_int;
-
-/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
-typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
-
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
@@ -179,6 +170,16 @@ typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
#define DIGIT(m, k) (MP_DEPRECATED_PRAGMA("DIGIT macro is deprecated, use z->dp instead") (m)->dp[(k)])
#define SIGN(m) (MP_DEPRECATED_PRAGMA("SIGN macro is deprecated, use z->sign instead") (m)->sign)
+/* the infamous mp_int structure */
+typedef struct {
+ int used, alloc, sign;
+ mp_digit *dp;
+} mp_int;
+
+/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
+typedef int mp_prime_callback(unsigned char *dst, int len, void *dat);
+typedef mp_prime_callback ltm_prime_callback MP_DEPRECATED(mp_prime_callback);
+
/* error code to char* string */
const char *mp_error_to_string(int code);
@@ -590,7 +591,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style);
* so it can be NULL
*
*/
-int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat);
+int mp_prime_random_ex(mp_int *a, int t, int size, int flags, mp_prime_callback cb, void *dat);
/* Integer logarithm to integer base */