Previously, this code would fail if gcd(e, phi(n)) != 1 happens 3 times in a
row.
Upped to 16.
As before, if this happens, another prime is tried.
CHECK(d0_bignum_gcd(temp4, NULL, NULL, temp2, ctx->rsa_e));
if(!d0_bignum_cmp(temp4, one))
break;
- if(++gcdfail == 3)
+ if(++gcdfail == 16)
goto fail;
++gcdfail;
}
if(!d0_bignum_cmp(temp1, ctx->rsa_d))
{
UNLOCKTEMPS();
- if(++fail == 3)
+ if(++fail == 16)
goto fail;
continue;
}
break;
}
UNLOCKTEMPS();
- if(++gcdfail == 3)
+ if(++gcdfail == 16)
goto fail;
++gcdfail;
}
CHECK(d0_bignum_gcd(temp4, NULL, NULL, temp2, ctx->rsa_e));
if(!d0_bignum_cmp(temp4, one))
break;
- if(++gcdfail == 3)
+ if(++gcdfail == 16)
return 0;
++gcdfail;
}
if(!d0_bignum_cmp(temp1, ctx->rsa_d))
{
UNLOCKTEMPS();
- if(++fail == 3)
+ if(++fail == 16)
return 0;
continue;
}
break;
}
UNLOCKTEMPS();
- if(++gcdfail == 3)
+ if(++gcdfail == 16)
return 0;
++gcdfail;
}