diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-12 12:00:11 (GMT) |
commit | ece45e7fb6469e3ee3ad49f168f8711fb36f93ce (patch) | |
tree | db4a77927de2a4d6c6cf2bc672ebda4098b9b1a0 /libtommath/bn_s_mp_exptmod.c | |
parent | 6f3388528ef453d29fbddba3f5a054d2f5268207 (diff) | |
parent | 473bfc0f18451046035f638732a609fc86d5a0aa (diff) | |
download | tcl-initsubsystems.zip tcl-initsubsystems.tar.gz tcl-initsubsystems.tar.bz2 |
merge trunkinitsubsystems
Diffstat (limited to 'libtommath/bn_s_mp_exptmod.c')
-rw-r--r-- | libtommath/bn_s_mp_exptmod.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c index ff6bd54..63e1b1e 100644 --- a/libtommath/bn_s_mp_exptmod.c +++ b/libtommath/bn_s_mp_exptmod.c @@ -1,4 +1,4 @@ -#include <tommath.h> +#include <tommath_private.h> #ifdef BN_S_MP_EXPTMOD_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 */ #ifdef MP_LOW_MEM #define TAB_SIZE 32 @@ -164,12 +164,12 @@ int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) * in the exponent. Technically this opt is not required but it * does lower the # of trivial squaring/reductions used */ - if (mode == 0 && y == 0) { + if ((mode == 0) && (y == 0)) { continue; } /* if the bit is zero and mode == 1 then we square */ - if (mode == 1 && y == 0) { + if ((mode == 1) && (y == 0)) { if ((err = mp_sqr (&res, &res)) != MP_OKAY) { goto LBL_RES; } @@ -211,7 +211,7 @@ int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) } /* if bits remain then square/multiply */ - if (mode == 2 && bitcpy > 0) { + if ((mode == 2) && (bitcpy > 0)) { /* square then multiply if the bit is set */ for (x = 0; x < bitcpy; x++) { if ((err = mp_sqr (&res, &res)) != MP_OKAY) { @@ -246,3 +246,7 @@ LBL_M: return err; } #endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ |