comparison libtommath/bn_mp_invmod.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
23 return MP_VAL; 23 return MP_VAL;
24 } 24 }
25 25
26 #ifdef BN_FAST_MP_INVMOD_C 26 #ifdef BN_FAST_MP_INVMOD_C
27 /* if the modulus is odd we can use a faster routine instead */ 27 /* if the modulus is odd we can use a faster routine instead */
28 if (mp_isodd (b) == MP_YES) { 28 if ((mp_isodd(b) == MP_YES) && (mp_cmp_d(b, 1) != MP_EQ)) {
29 return fast_mp_invmod (a, b, c); 29 return fast_mp_invmod (a, b, c);
30 } 30 }
31 #endif 31 #endif
32 32
33 #ifdef BN_MP_INVMOD_SLOW_C 33 #ifdef BN_MP_INVMOD_SLOW_C
36 return MP_VAL; 36 return MP_VAL;
37 #endif 37 #endif
38 } 38 }
39 #endif 39 #endif
40 40
41 /* $Source$ */ 41 /* ref: $Format:%D$ */
42 /* $Revision$ */ 42 /* git commit: $Format:%H$ */
43 /* $Date$ */ 43 /* commit time: $Format:%ai$ */