diff options
| author | J08nY | 2025-03-23 17:06:57 +0100 |
|---|---|---|
| committer | J08nY | 2025-03-23 17:06:57 +0100 |
| commit | e7341fa4dfc03570eb97f0b4b6fad60af445a282 (patch) | |
| tree | d5d53af1d0556aa64cc0c19474f7c8d018f02188 /src/cm/cm_any.c | |
| parent | ea8200d09d93a7b45332cb897f80464a761e766f (diff) | |
| download | ecgen-e7341fa4dfc03570eb97f0b4b6fad60af445a282.tar.gz ecgen-e7341fa4dfc03570eb97f0b4b6fad60af445a282.tar.zst ecgen-e7341fa4dfc03570eb97f0b4b6fad60af445a282.zip | |
Have a bound on the CM walkdown, the discriminant grows too much otherwise.
Diffstat (limited to '')
| -rw-r--r-- | src/cm/cm_any.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/cm/cm_any.c b/src/cm/cm_any.c index 368ce77..cd319ab 100644 --- a/src/cm/cm_any.c +++ b/src/cm/cm_any.c @@ -353,15 +353,9 @@ GENERATOR(cm_gen_curve_unique) { const char *order_s = (const char *)args->args; GEN order = strtoi(order_s); GEN e; - if (min_d && min_roots && min_curve == curve && - min_roots->used < min_roots->total) { - debug_log("Reusing roots."); - // We can just use the roots we have stored and take some out. - e = cm_construct_curve(order, min_d->d, min_d->p, min_roots, false); - } else if (min_d && min_curve == curve) { + if (min_d && min_curve == curve) { debug_log("Reusing min D = %Pi", min_d->d); - // We just have the discriminant but no roots (or they are used up), we - // need to continue + // We have some discriminant, cannot use the roots because the D with walkdown was too large. if (min_d->d && isclone(min_d->d)) { gunclone(min_d->d); } @@ -421,9 +415,17 @@ GENERATOR(cm_gen_curve_unique) { GEN power = gel(powers, i); debug_log("Walking down with %Pi %Pi", prime, power); GEN exp = mulis(power, 2); + debug_log("%Pi, %Pi", prime, exp); GEN mul = powii(prime, exp); + debug_log("%Pi", mul); d = mulii(d, mul); + debug_log("d %Pi", d); } + if (logint(d, gen_2) > 64) { + fprintf(err, "Discriminant too large."); + avma = ltop; + return -3; + } if (min_d->d && isclone(min_d->d)) { gunclone(min_d->d); } |
