aboutsummaryrefslogtreecommitdiff
path: root/src/math/order.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/order.c')
-rw-r--r--src/math/order.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/math/order.c b/src/math/order.c
index 7f90849..3235a30 100644
--- a/src/math/order.c
+++ b/src/math/order.c
@@ -14,6 +14,19 @@ int order_any(curve_t *curve, const config_t *cfg, arg_t *args) {
return 1;
}
+int order_sea(curve_t *curve, const config_t *cfg, arg_t *args) {
+ pari_sp ltop = avma;
+ GEN order = ellsea(curve->curve, 0);
+ if (gequal0(order)) {
+ avma = ltop;
+ return -4;
+ } else {
+ curve->order = order;
+ obj_insert_shallow(curve->curve, 1, order);
+ return 1;
+ }
+}
+
int order_smallfact(curve_t *curve, const config_t *cfg, arg_t *args) {
if (!args) {
fprintf(stderr, "No args to an arged function. order_smallfact");
@@ -34,7 +47,7 @@ int order_smallfact(curve_t *curve, const config_t *cfg, arg_t *args) {
return -4;
} else {
curve->order = order;
- obj_insert(curve->curve, 1, curve->order);
+ obj_insert_shallow(curve->curve, 1, curve->order);
return 1;
}
}
@@ -47,7 +60,7 @@ int order_prime(curve_t *curve, const config_t *cfg, arg_t *args) {
return -4;
} else {
curve->order = order;
- obj_insert(curve->curve, 1, curve->order);
+ obj_insert_shallow(curve->curve, 1, curve->order);
return 1;
}
}