summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-03-25 19:15:03 +0100
committerJ08nY2017-03-25 19:15:03 +0100
commit797c95c15c6c8f2e312fa402f5eb63b41697a406 (patch)
treec71e2dc6c1c5472bf294c003a4fc21d6326559ef
parent7c01c2c0088b56def7ee2b7fe638b21fe1206981 (diff)
downloadecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.tar.gz
ecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.tar.zst
ecgen-797c95c15c6c8f2e312fa402f5eb63b41697a406.zip
-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;