mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Update to libtommath v1.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include <tommath.h>
|
||||
#include <tommath_private.h>
|
||||
#ifdef BN_MP_ADD_D_C
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis
|
||||
*
|
||||
@@ -12,7 +12,7 @@
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
|
||||
*/
|
||||
|
||||
/* single digit addition */
|
||||
@@ -23,14 +23,14 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c)
|
||||
mp_digit *tmpa, *tmpc, mu;
|
||||
|
||||
/* grow c as required */
|
||||
if (c->alloc < a->used + 1) {
|
||||
if (c->alloc < (a->used + 1)) {
|
||||
if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/* if a is negative and |a| >= b, call c = |a| - b */
|
||||
if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
|
||||
if ((a->sign == MP_NEG) && ((a->used > 1) || (a->dp[0] >= b))) {
|
||||
/* temporarily fix sign of a */
|
||||
a->sign = MP_ZPOS;
|
||||
|
||||
@@ -107,6 +107,6 @@ 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.4 $ */
|
||||
/* $Date: 2006/03/31 14:18:44 $ */
|
||||
/* $Source$ */
|
||||
/* $Revision$ */
|
||||
/* $Date$ */
|
||||
|
||||
Reference in New Issue
Block a user