diff libtommath/bn_mp_invmod.c @ 1511:5916af64acd4 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Sat, 17 Feb 2018 19:29:51 +0800
parents 8bba51a55704
children f52919ffd3b1
line wrap: on
line diff
--- a/libtommath/bn_mp_invmod.c	Tue Jan 23 23:27:40 2018 +0800
+++ b/libtommath/bn_mp_invmod.c	Sat Feb 17 19:29:51 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$ */