summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_mul.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-13 15:39:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-13 15:39:23 (GMT)
commite43882908292c514bc01b2ca0c63ce6d0611c692 (patch)
treea73b0f280a2440f778b4ce2e29c09f8bee03a85b /libtommath/bn_mp_mul.c
parent94e8f6336742c2df3ad63efbb598af741e0e7c5b (diff)
parent4cef9fbbe29e5ba76aaa7eaa7e91dd9b7d22e471 (diff)
downloadtcl-e43882908292c514bc01b2ca0c63ce6d0611c692.zip
tcl-e43882908292c514bc01b2ca0c63ce6d0611c692.tar.gz
tcl-e43882908292c514bc01b2ca0c63ce6d0611c692.tar.bz2
Merge 8.7
Diffstat (limited to 'libtommath/bn_mp_mul.c')
-rw-r--r--libtommath/bn_mp_mul.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libtommath/bn_mp_mul.c b/libtommath/bn_mp_mul.c
index c4890c5..91707cd 100644
--- a/libtommath/bn_mp_mul.c
+++ b/libtommath/bn_mp_mul.c
@@ -12,9 +12,7 @@ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
digs = a->used + b->used + 1;
mp_sign neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
- if (a == b) {
- return mp_sqr(a,c);
- } else if (MP_HAS(S_MP_BALANCE_MUL) &&
+ if (MP_HAS(S_MP_BALANCE_MUL) &&
/* Check sizes. The smaller one needs to be larger than the Karatsuba cut-off.
* The bigger one needs to be at least about one MP_KARATSUBA_MUL_CUTOFF bigger
* to make some sense, but it depends on architecture, OS, position of the
@@ -37,10 +35,10 @@ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
/* can we use the fast multiplier?
*
* The fast multiplier can be used if the output will
- * have less than PRIVATE_MP_WARRAY digits and the number of
+ * have less than MP_WARRAY digits and the number of
* digits won't affect carry propagation
*/
- (digs < PRIVATE_MP_WARRAY) &&
+ (digs < MP_WARRAY) &&
(min_len <= MP_MAXFAST)) {
err = s_mp_mul_digs_fast(a, b, c, digs);
} else if (MP_HAS(S_MP_MUL_DIGS)) {