Skip to content

Commit

Permalink
commit fix for #67 from libtommath repo
Browse files Browse the repository at this point in the history
thanks to @karel-m for the fix!
  • Loading branch information
timo committed Mar 10, 2017
1 parent b8527e9 commit 8ae5ddf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bn_mp_invmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
}

#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 the modulus is odd (but not 1) we can use a faster routine instead */
if ((mp_isodd (b) == MP_YES) && (mp_cmp_d (b, 1) != MP_EQ)) {
return fast_mp_invmod (a, b, c);
}
#endif
Expand Down

0 comments on commit 8ae5ddf

Please sign in to comment.