Diff
Not logged in

Differences From Artifact [67a21ae012]:

To Artifact [43e00c939b]:


33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
  if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
     /* temporarily fix sign of a */
     a->sign = MP_ZPOS;

     /* c = |a| - b */
     res = mp_sub_d(a, b, c);

     /* fix sign  */
     a->sign = c->sign = MP_NEG;


     return res;
  }

  /* old number of used digits in c */
  oldused = c->used;








|
|
>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
     /* temporarily fix sign of a */
     a->sign = MP_ZPOS;

     /* c = |a| - b */
     res = mp_sub_d(a, b, c);

     /* fix signs  */
     a->sign = MP_NEG;
     c->sign = (c->used) ? MP_NEG : MP_ZPOS;

     return res;
  }

  /* old number of used digits in c */
  oldused = c->used;

101
102
103
104
105
106
107
108
109

  return MP_OKAY;
}

#endif

/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add_d.c,v $ */
/* $Revision: 1.1.1.2 $ */
/* $Date: 2005/09/26 16:31:56 $ */







|
|
102
103
104
105
106
107
108
109
110

  return MP_OKAY;
}

#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 $ */