diff 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
line wrap: on
line diff
--- a/libtommath/bn_mp_invmod.c	Sat Jun 24 23:33:16 2017 +0800
+++ b/libtommath/bn_mp_invmod.c	Fri Feb 09 23:49:22 2018 +0800
@@ -25,7 +25,7 @@
 
 #ifdef BN_FAST_MP_INVMOD_C
   /* if the modulus is odd we can use a faster routine instead */
-  if (mp_isodd (b) == MP_YES) {
+  if ((mp_isodd(b) == MP_YES) && (mp_cmp_d(b, 1) != MP_EQ)) {
     return fast_mp_invmod (a, b, c);
   }
 #endif
@@ -38,6 +38,6 @@
 }
 #endif
 
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref:         $Format:%D$ */
+/* git commit:  $Format:%H$ */
+/* commit time: $Format:%ai$ */