Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8c927a17 authored by ZIMMERMANN Paul's avatar ZIMMERMANN Paul
Browse files

fixed #21876

parent b02836a6
No related branches found
No related tags found
No related merge requests found
Pipeline #997304 passed
......@@ -425,11 +425,15 @@ int
get_curve_from_random_parameter (mpz_t f, mpres_t A, mpres_t x, mpz_t sigma,
int param, mpmod_t modulus, gmp_randstate_t rng)
{
int ret;
int ret = ECM_ERROR;
/* initialize the random number generator if not already done */
init_randstate (rng);
do
/* we perform only a fixed number of tries to find a suitable curve,
to avoid an infinite loop in corner cases (for example with -param 1,
there is no valid sigma for n=3, see
https://gitlab.inria.fr/zimmerma/ecm/-/issues/21876) */
for (int i = 0; ret == ECM_ERROR && i < 10; i++)
{
if (param == ECM_PARAM_SUYAMA)
{
......@@ -453,7 +457,7 @@ get_curve_from_random_parameter (mpz_t f, mpres_t A, mpres_t x, mpz_t sigma,
}
else
return ECM_ERROR;
} while (ret == ECM_ERROR);
}
return ret;
}
......
......@@ -534,6 +534,9 @@ checkcode $? 0
echo 18446744073709551557 | $ECM -param 1 -A 312656731337392125 11000
checkcode $? 8
# non-regression test for https://gitlab.inria.fr/zimmerma/ecm/-/issues/21876
echo 3 | $ECM -param 1 1000 1000; checkcode $? 1
# test -bsaves/-bloads
TEST=test.ecm.s$$
echo 18446744073709551557 | $ECM -param 1 -A 1 -bsaves $TEST 11000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment