diff options
| author | J08nY | 2017-03-25 19:15:03 +0100 |
|---|---|---|
| committer | J08nY | 2017-03-25 19:15:03 +0100 |
| commit | 797c95c15c6c8f2e312fa402f5eb63b41697a406 (patch) | |
| tree | c71e2dc6c1c5472bf294c003a4fc21d6326559ef | |
| parent | 7c01c2c0088b56def7ee2b7fe638b21fe1206981 (diff) | |
| download | ecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.tar.gz ecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.tar.zst ecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.zip | |
| -rw-r--r-- | src/math/order.c | 9 |
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; |
