diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-08-29 19:52:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-08-29 19:52:35 (GMT) |
commit | 92265d56a363a605b8a68d54cf49aa9a11448a1f (patch) | |
tree | 915f0c4344c7f680ee86ba8cce24deb9b0b40bc2 /libtommath/bn_mp_exptmod_fast.c | |
parent | f10147dbfeaa7cecc2fa78fd50a35681a63b7de5 (diff) | |
download | tcl-92265d56a363a605b8a68d54cf49aa9a11448a1f.zip tcl-92265d56a363a605b8a68d54cf49aa9a11448a1f.tar.gz tcl-92265d56a363a605b8a68d54cf49aa9a11448a1f.tar.bz2 |
libtommath 1.0.1 rc 2
Diffstat (limited to 'libtommath/bn_mp_exptmod_fast.c')
-rw-r--r-- | libtommath/bn_mp_exptmod_fast.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c index 8d280bd..312305e 100644 --- a/libtommath/bn_mp_exptmod_fast.c +++ b/libtommath/bn_mp_exptmod_fast.c @@ -67,13 +67,13 @@ int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode /* init M array */ /* init first cell */ - if ((err = mp_init(&M[1])) != MP_OKAY) { + if ((err = mp_init_size(&M[1], P->alloc)) != MP_OKAY) { return err; } /* now init the second half of the array */ for (x = 1<<(winsize-1); x < (1 << winsize); x++) { - if ((err = mp_init(&M[x])) != MP_OKAY) { + if ((err = mp_init_size(&M[x], P->alloc)) != MP_OKAY) { for (y = 1<<(winsize-1); y < x; y++) { mp_clear (&M[y]); } @@ -133,7 +133,7 @@ int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode } /* setup result */ - if ((err = mp_init (&res)) != MP_OKAY) { + if ((err = mp_init_size (&res, P->alloc)) != MP_OKAY) { goto LBL_M; } @@ -150,15 +150,15 @@ int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { goto LBL_RES; } -#else - err = MP_VAL; - goto LBL_RES; -#endif /* now set M[1] to G * R mod m */ if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { goto LBL_RES; } +#else + err = MP_VAL; + goto LBL_RES; +#endif } else { mp_set(&res, 1); if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) { @@ -316,6 +316,6 @@ LBL_M: #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: HEAD -> release/1.0.1, tag: v1.0.1-rc2 */ +/* git commit: e8c27ba7df0efb90708029115c94d681dfa7812f */ +/* commit time: 2017-08-29 10:48:46 +0200 */ |