comparison libtommath/bn_mp_exptmod_fast.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 8bba51a55704
children f52919ffd3b1
comparison
equal deleted inserted replaced
1439:8d24733026c5 1478:3a933956437e
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$ */