summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_add_d.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-14 13:17:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-03-14 13:17:42 (GMT)
commite37816295674d1f53f8a42ed360885bfd7b1bb26 (patch)
treeaab3e98644bbfdde7cee9e7d0644843efc3b481b /libtommath/bn_mp_add_d.c
parentd7240e068504daa6bd88d4997196572f848e29ad (diff)
parent8f3d2ff6163cce22d1c9b8c00a0051a9164fed0d (diff)
downloadtcl-e37816295674d1f53f8a42ed360885bfd7b1bb26.zip
tcl-e37816295674d1f53f8a42ed360885bfd7b1bb26.tar.gz
tcl-e37816295674d1f53f8a42ed360885bfd7b1bb26.tar.bz2
Revert previous commit: I was not aware that we have a fork of libtommathmistake_20110314a
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 $ */