X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/ba6c138883c51f7f14ea09c65159cd63c833574a..HEAD:/pub/rsa-recover.c diff --git a/pub/rsa-recover.c b/pub/rsa-recover.c index f852f695..055d969a 100644 --- a/pub/rsa-recover.c +++ b/pub/rsa-recover.c @@ -97,7 +97,7 @@ int rsa_recover(rsa_priv *rp) /* --- Set up for the exponentiation --- */ - mpmont_create(&mm, rp->n); + if (mpmont_create(&mm, rp->n)) goto out; m1 = mp_sub(m1, rp->n, mm.r); /* --- Now for the main loop --- * @@ -116,6 +116,7 @@ int rsa_recover(rsa_priv *rp) * is a failure. */ + if (i > NPRIME) goto out; aw = primetab[i++]; z = mpmont_mul(&mm, z, &a, mm.r2); z = mpmont_expr(&mm, z, z, t);