aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cm/cm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cm/cm.c b/src/cm/cm.c
index c604876..a3a70a2 100644
--- a/src/cm/cm.c
+++ b/src/cm/cm.c
@@ -181,6 +181,14 @@ static int cm_init(exhaustive_t *setup) {
fprintf(err, "Order requested not a number: %s\n", cfg->cm_order);
return 1;
}
+ long ord_log = logint0(order, gen_2, NULL);
+ if (ord_log > cfg->bits) {
+ pari_fprintf(err,
+ "Order requested does not fit(2^%li) into requested "
+ "bitsize(2^%li): %Pi\n",
+ ord_log, cfg->bits, order);
+ return 1;
+ }
if (delims == 0) {
ord_prime = (bool)isprime(order);
} else {