summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathDecls.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-28 14:16:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-28 14:16:02 (GMT)
commitb85e550f93b7a36f7331536c7bbc49282c331d1c (patch)
treebb1cf4980604105ce2246965f67bd9a68c3ebdc9 /generic/tclTomMathDecls.h
parent402e47970bb3d0b07bd25cb83947972ff1e822ff (diff)
downloadtcl-b85e550f93b7a36f7331536c7bbc49282c331d1c.zip
tcl-b85e550f93b7a36f7331536c7bbc49282c331d1c.tar.gz
tcl-b85e550f93b7a36f7331536c7bbc49282c331d1c.tar.bz2
Take care of the deprecation of mp_expt_u32
Diffstat (limited to 'generic/tclTomMathDecls.h')
-rw-r--r--generic/tclTomMathDecls.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index 35eb9f8..e62c90e 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -65,11 +65,13 @@ extern "C" {
#endif
MODULE_SCOPE mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
MODULE_SCOPE mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, mp_digit *r);
-MODULE_SCOPE mp_err TclBN_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c);
-MODULE_SCOPE mp_err TclBN_mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c);
-MODULE_SCOPE mp_err TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
-MODULE_SCOPE mp_err TclBN_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c);
-MODULE_SCOPE mp_err TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
+MODULE_SCOPE mp_err TclBN_mp_expt_n(const mp_int *a, int b, mp_int *c);
+MODULE_SCOPE mp_err TclBN_s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c);
+MODULE_SCOPE mp_err TclBN_s_mp_div_3(const mp_int *a, mp_int *c, mp_digit *d);
+MODULE_SCOPE mp_err TclBN_s_mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c);
+MODULE_SCOPE mp_err TclBN_s_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
+MODULE_SCOPE mp_err TclBN_s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c);
+MODULE_SCOPE mp_err TclBN_s_mp_toom_sqr(const mp_int *a, mp_int *b);
MODULE_SCOPE mp_err TclBN_s_mp_add(const mp_int *a, const mp_int *b, mp_int *c);
MODULE_SCOPE mp_err TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs);
MODULE_SCOPE mp_err TclBN_s_mp_mul_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs);
@@ -110,6 +112,7 @@ MODULE_SCOPE mp_err TclBN_mp_set_int(mp_int *a, unsigned long b);
#define mp_expt_d TclBN_mp_expt_d
#define mp_expt_d_ex TclBN_mp_expt_d_ex
#define mp_expt_u32 TclBN_mp_expt_u32
+#define mp_expt_n TclBN_mp_expt_n
#define mp_get_mag_u64 TclBN_mp_get_mag_u64
#define mp_grow TclBN_mp_grow
#define mp_init TclBN_mp_init
@@ -159,17 +162,18 @@ MODULE_SCOPE mp_err TclBN_mp_set_int(mp_int *a, unsigned long b);
#define mp_xor TclBN_mp_xor
#define mp_zero TclBN_mp_zero
#define s_mp_add TclBN_s_mp_add
-#define s_mp_balance_mul TclBN_mp_balance_mul
-#define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul
-#define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
+#define s_mp_balance_mul TclBN_s_mp_balance_mul
+#define s_mp_div_3 TclBN_s_mp_div_3
+#define s_mp_karatsuba_mul TclBN_s_mp_karatsuba_mul
+#define s_mp_karatsuba_sqr TclBN_s_mp_karatsuba_sqr
#define s_mp_mul_digs TclBN_s_mp_mul_digs
#define s_mp_mul_digs_fast TclBN_s_mp_mul_digs_fast
#define s_mp_reverse TclBN_s_mp_reverse
#define s_mp_sqr TclBN_s_mp_sqr
#define s_mp_sqr_fast TclBN_s_mp_sqr_fast
#define s_mp_sub TclBN_s_mp_sub
-#define s_mp_toom_mul TclBN_mp_toom_mul
-#define s_mp_toom_sqr TclBN_mp_toom_sqr
+#define s_mp_toom_mul TclBN_s_mp_toom_mul
+#define s_mp_toom_sqr TclBN_s_mp_toom_sqr
#endif /* !TCL_WITH_EXTERNAL_TOMMATH */
#undef TCL_STORAGE_CLASS
@@ -243,8 +247,7 @@ EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
/* 18 */
EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
/* 19 */
-EXTERN mp_err TclBN_mp_expt_u32(const mp_int *a, uint32_t b,
- mp_int *c) MP_WUR;
+EXTERN mp_err TclBN_mp_expt_n(const mp_int *a, int b, mp_int *c) MP_WUR;
/* 20 */
EXTERN mp_err TclBN_mp_grow(mp_int *a, int size) MP_WUR;
/* 21 */
@@ -386,7 +389,7 @@ typedef struct TclTomMathStubs {
mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r) MP_WUR; /* 16 */
void (*reserved17)(void);
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
- mp_err (*tclBN_mp_expt_u32) (const mp_int *a, uint32_t b, mp_int *c) MP_WUR; /* 19 */
+ mp_err (*tclBN_mp_expt_n) (const mp_int *a, int b, mp_int *c) MP_WUR; /* 19 */
mp_err (*tclBN_mp_grow) (mp_int *a, int size) MP_WUR; /* 20 */
mp_err (*tclBN_mp_init) (mp_int *a) MP_WUR; /* 21 */
mp_err (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b) MP_WUR; /* 22 */
@@ -499,8 +502,8 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
/* Slot 17 is reserved */
#define TclBN_mp_exch \
(tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
-#define TclBN_mp_expt_u32 \
- (tclTomMathStubsPtr->tclBN_mp_expt_u32) /* 19 */
+#define TclBN_mp_expt_n \
+ (tclTomMathStubsPtr->tclBN_mp_expt_n) /* 19 */
#define TclBN_mp_grow \
(tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
#define TclBN_mp_init \