summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_add_d.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-14 13:20:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-14 13:20:06 (GMT)
commit2f7b3b25a44b2d4cae788262d093a4c2cbfee216 (patch)
tree02c154fcc3fcad9cbbb9be91ecb192bd6cf75ebf /libtommath/bn_mp_add_d.c
parent072f17eb971ae3d3aff015ca39063774c876a17a (diff)
parente37816295674d1f53f8a42ed360885bfd7b1bb26 (diff)
downloadtcl-2f7b3b25a44b2d4cae788262d093a4c2cbfee216.zip
tcl-2f7b3b25a44b2d4cae788262d093a4c2cbfee216.tar.gz
tcl-2f7b3b25a44b2d4cae788262d093a4c2cbfee216.tar.bz2
Revert previous commit: I was not aware that we have a fork of libtommathmistake_20110314
Diffstat (limited to 'libtommath/bn_mp_add_d.c')
-rw-r--r--libtommath/bn_mp_add_d.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c
index 8ca36c1..5281ad4 100644
--- a/libtommath/bn_mp_add_d.c
+++ b/libtommath/bn_mp_add_d.c
@@ -12,7 +12,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
+ * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
*/
/* single digit addition */
@@ -37,8 +37,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
/* c = |a| - b */
res = mp_sub_d(a, b, c);
- /* fix sign */
- a->sign = c->sign = MP_NEG;
+ /* fix signs */
+ a->sign = MP_NEG;
+ c->sign = (c->used) ? MP_NEG : MP_ZPOS;
/* clamp */
mp_clamp(c);
@@ -106,7 +107,3 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
}
#endif
-
-/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */
-/* $Revision: 1.5 $ */
-/* $Date: 2006/12/28 01:25:13 $ */