]> de.git.xonotic.org Git - xonotic/d0_blind_id.git/blobdiff - d0_blind_id.c
RSA keygen: when generating a key, don't fail so often.
[xonotic/d0_blind_id.git] / d0_blind_id.c
index f1cd22e4e14172707b6c6e07826d1d4a9b2ec581..e62c72412d5069ddde2d0b4d474bd70a07a2573a 100644 (file)
@@ -229,7 +229,7 @@ static D0_BOOL d0_rsa_generate_key(size_t size, d0_blind_id_t *ctx)
                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;
        }
@@ -243,7 +243,7 @@ static D0_BOOL d0_rsa_generate_key(size_t size, d0_blind_id_t *ctx)
                if(!d0_bignum_cmp(temp1, ctx->rsa_d))
                {
                        UNLOCKTEMPS();
-                       if(++fail == 3)
+                       if(++fail == 16)
                                goto fail;
                        continue;
                }
@@ -261,7 +261,7 @@ static D0_BOOL d0_rsa_generate_key(size_t size, d0_blind_id_t *ctx)
                        break;
                }
                UNLOCKTEMPS();
-               if(++gcdfail == 3)
+               if(++gcdfail == 16)
                        goto fail;
                ++gcdfail;
        }
@@ -307,7 +307,7 @@ static D0_BOOL d0_rsa_generate_key_fastreject(size_t size, d0_fastreject_functio
                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;
        }
@@ -321,7 +321,7 @@ static D0_BOOL d0_rsa_generate_key_fastreject(size_t size, d0_fastreject_functio
                if(!d0_bignum_cmp(temp1, ctx->rsa_d))
                {
                        UNLOCKTEMPS();
-                       if(++fail == 3)
+                       if(++fail == 16)
                                return 0;
                        continue;
                }
@@ -348,7 +348,7 @@ static D0_BOOL d0_rsa_generate_key_fastreject(size_t size, d0_fastreject_functio
                        break;
                }
                UNLOCKTEMPS();
-               if(++gcdfail == 3)
+               if(++gcdfail == 16)
                        return 0;
                ++gcdfail;
        }