make
[openssl.git] / crypto / rsa / rsa_gen.c
index 839a3eeb8fe778e3c8643886a3db0c0586608061..383d6095f57c989522d1aa6ec860d7f8a7f10173 100644 (file)
@@ -139,7 +139,7 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
                if(degenerate == 3)
                        {
                        ok = 0; /* we set our own err */
-                       RSAerr(RSA_F_RSA_GENERATE_KEY,RSA_R_KEY_SIZE_TOO_SMALL);
+                       RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,RSA_R_KEY_SIZE_TOO_SMALL);
                        goto err;
                        }
                if (!BN_sub(r2,rsa->q,BN_value_one())) goto err;
@@ -165,22 +165,6 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
        if (!BN_sub(r1,rsa->p,BN_value_one())) goto err;        /* p-1 */
        if (!BN_sub(r2,rsa->q,BN_value_one())) goto err;        /* q-1 */
        if (!BN_mul(r0,r1,r2,ctx)) goto err;    /* (p-1)(q-1) */
-
-/* should not be needed, since gcd(p-1,e) == 1 and gcd(q-1,e) == 1 */
-/*     for (;;)
-               {
-               if (!BN_gcd(r3,r0,rsa->e,ctx)) goto err;
-               if (BN_is_one(r3)) break;
-
-               if (1)
-                       {
-                       if (!BN_add_word(rsa->e,2L)) goto err;
-                       continue;
-                       }
-               RSAerr(RSA_F_RSA_GENERATE_KEY,RSA_R_BAD_E_VALUE);
-               goto err;
-               }
-*/
        if (!BN_mod_inverse(rsa->d,rsa->e,r0,ctx)) goto err;    /* d */
 
        /* calculate d mod (p-1) */
@@ -196,7 +180,7 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
 err:
        if (ok == -1)
                {
-               RSAerr(RSA_F_RSA_GENERATE_KEY,ERR_LIB_BN);
+               RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,ERR_LIB_BN);
                ok=0;
                }
        BN_CTX_end(ctx);