847
847
if (!BN_mod(r0,pr1,rsa->p,ctx)) goto err;
849
849
/* If p < q it is occasionally possible for the correction of
851
851
* negative. This can break the private key operations: the following
852
852
* second correction should *always* correct this rare occurrence.
853
853
* This will *never* happen with OpenSSL generated keys because
857
857
if (!BN_add(r0,r0,rsa->p)) goto err;
858
858
if (!BN_mul(r1,r0,rsa->q,ctx)) goto err;