comparison libtommath/bn_mp_exptmod_fast.c @ 1470:8bba51a55704

Update to libtommath v1.0.1
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Feb 2018 23:11:40 +0800
parents 60fc6476e044
children f52919ffd3b1
comparison
equal deleted inserted replaced
1469:51043e868f55 1470:8bba51a55704
148 #ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C 148 #ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
149 /* now we need R mod m */ 149 /* now we need R mod m */
150 if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { 150 if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) {
151 goto LBL_RES; 151 goto LBL_RES;
152 } 152 }
153 #else
154 err = MP_VAL;
155 goto LBL_RES;
156 #endif
157 153
158 /* now set M[1] to G * R mod m */ 154 /* now set M[1] to G * R mod m */
159 if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { 155 if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) {
160 goto LBL_RES; 156 goto LBL_RES;
161 } 157 }
158 #else
159 err = MP_VAL;
160 goto LBL_RES;
161 #endif
162 } else { 162 } else {
163 mp_set(&res, 1); 163 mp_set(&res, 1);
164 if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) { 164 if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
165 goto LBL_RES; 165 goto LBL_RES;
166 } 166 }
314 return err; 314 return err;
315 } 315 }
316 #endif 316 #endif
317 317
318 318
319 /* $Source$ */ 319 /* ref: $Format:%D$ */
320 /* $Revision$ */ 320 /* git commit: $Format:%H$ */
321 /* $Date$ */ 321 /* commit time: $Format:%ai$ */