summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_s_mp_exptmod.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-03-01 20:43:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-03-01 20:43:31 (GMT)
commit5753c7a42b638962406f9f7f822e48561e7a6253 (patch)
tree65742203dd83d002e9c923ddf96ddf45460e0d05 /libtommath/bn_s_mp_exptmod.c
parent6881a1a27437cae50d56f12227e9cfe10c7a49f2 (diff)
downloadtcl-5753c7a42b638962406f9f7f822e48561e7a6253.zip
tcl-5753c7a42b638962406f9f7f822e48561e7a6253.tar.gz
tcl-5753c7a42b638962406f9f7f822e48561e7a6253.tar.bz2
Lots of code cleanup, mainly [https://github.com/libtom/libtommath/pull/102|Pull request #102]
Diffstat (limited to 'libtommath/bn_s_mp_exptmod.c')
-rw-r--r--libtommath/bn_s_mp_exptmod.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c
index a886361..a954757 100644
--- a/libtommath/bn_s_mp_exptmod.c
+++ b/libtommath/bn_s_mp_exptmod.c
@@ -14,6 +14,7 @@
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
+
#ifdef MP_LOW_MEM
# define TAB_SIZE 32
#else
@@ -25,7 +26,7 @@ int s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, i
mp_int M[TAB_SIZE], res, mu;
mp_digit buf;
int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
- int (*redux)(mp_int *, const mp_int *, const mp_int *);
+ int (*redux)(mp_int *x, const mp_int *m, const mp_int *mu);
/* find window size */
x = mp_count_bits(X);
@@ -133,7 +134,7 @@ int s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, i
if ((err = mp_init(&res)) != MP_OKAY) {
goto LBL_MU;
}
- mp_set(&res, 1);
+ mp_set(&res, 1uL);
/* set initial mode and bit cnt */
mode = 0;