summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-12-27 18:10:11 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-12-27 18:10:11 (GMT)
commitfaf5b2a1486bab42c4c1f954aa4d784c3adbf0a7 (patch)
tree29de82eb32f51f9f362059461df11fb11ad7dd3b
parent98036f8f9d6591f75cbbb744ae789e53250d2459 (diff)
downloadtcl-faf5b2a1486bab42c4c1f954aa4d784c3adbf0a7.zip
tcl-faf5b2a1486bab42c4c1f954aa4d784c3adbf0a7.tar.gz
tcl-faf5b2a1486bab42c4c1f954aa4d784c3adbf0a7.tar.bz2
Merge changes
-rw-r--r--libtommath/bn_mp_add_d.c6
-rw-r--r--libtommath/bn_mp_radix_size.c5
-rw-r--r--libtommath/bn_mp_read_radix.c7
3 files changed, 11 insertions, 7 deletions
diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c
index d472353..38ae268 100644
--- a/libtommath/bn_mp_add_d.c
+++ b/libtommath/bn_mp_add_d.c
@@ -41,6 +41,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
a->sign = MP_NEG;
c->sign = (c->used) ? MP_NEG : MP_ZPOS;
+ /* clamp */
+ mp_clamp(c);
+
return res;
}
@@ -106,5 +109,4 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
#endif
/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add_d.c,v $ */
-/* $Revision: 1.2 $ */
-/* $Date: 2005/10/08 14:42:54 $ */
+/* Tom's revision is 1.2 */
diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c
index 3381a6c..a8b98af2 100644
--- a/libtommath/bn_mp_radix_size.c
+++ b/libtommath/bn_mp_radix_size.c
@@ -36,7 +36,7 @@ int mp_radix_size (mp_int * a, int radix, int *size)
}
if (mp_iszero(a) == MP_YES) {
- *size = 2;
+ *size = 2;
return MP_OKAY;
}
@@ -83,5 +83,4 @@ int mp_radix_size (mp_int * a, int radix, int *size)
#endif
/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_radix_size.c,v $ */
-/* $Revision: 1.3 $ */
-/* $Date: 2005/09/26 18:27:14 $ */
+/* Tom's revision is 1.3 */
diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c
index 2a11a36..fceccb7 100644
--- a/libtommath/bn_mp_read_radix.c
+++ b/libtommath/bn_mp_read_radix.c
@@ -21,6 +21,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
int y, res, neg;
char ch;
+ /* zero the digit bignum */
+ mp_zero(a);
+
/* make sure the radix is ok */
if (radix < 2 || radix > 64) {
return MP_VAL;
@@ -85,5 +88,5 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
#endif
/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_radix.c,v $ */
-/* $Revision: 1.3 $ */
-/* $Date: 2005/09/26 18:27:14 $ */
+/* Tom's revision is 1.3. */
+