From 797c95c15c6c8f2e312fa402f5eb63b41697a406 Mon Sep 17 00:00:00 2001 From: J08nY Date: Sat, 25 Mar 2017 19:15:03 +0100 Subject: Fixed cofactor generation for larger bounds. --- src/math/order.c | 9 +++++---- 1 file 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; -- cgit v1.2.3-70-g09d2