aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/math/order.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/math/order.c b/src/math/order.c
index 89343e6..e7abf56 100644
--- a/src/math/order.c
+++ b/src/math/order.c
@@ -17,12 +17,13 @@ int order_smallfact(curve_t *curve, config_t *cfg, arg_t *args) {
pari_ulong smallfact = *(pari_ulong *)args->args;
pari_sp ltop = avma;
GEN fact = mpfact(smallfact);
- if (lgefint(fact) > 3) {
- fprintf(stderr, "Cofactor too large.");
- return INT_MIN;
+ if (lgefint(fact) > 3) {
+ smallfact = 0;
+ } else {
+ smallfact = itou(fact);
}
- GEN order = ellsea(curve->curve, itou(fact));
+ GEN order = ellsea(curve->curve, smallfact);
if (gequal0(order) || gequal1(gcdii(order, fact))) {
avma = ltop;
return -4;