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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/math/order.c b/src/math/order.c
index 347015c..2c963f6 100644
--- a/src/math/order.c
+++ b/src/math/order.c
@@ -3,6 +3,7 @@
* Copyright (C) 2017 J08nY
*/
#include "order.h"
+#include "io/input.h"
GEN order_factors(curve_t *curve, const config_t *cfg) {
if (cfg->prime) {
@@ -37,6 +38,19 @@ GEN order_groups(curve_t *curve, const config_t *cfg, GEN factors) {
}
}
+GENERATOR(order_gen_input) {
+ pari_sp ltop = avma;
+ GEN ord = input_int("order", cfg->bits);
+ if (gequalm1(ord)) {
+ avma = ltop;
+ return -4;
+ } else {
+ curve->order = ord;
+ obj_insert_shallow(curve->curve, 1, ord);
+ return 1;
+ }
+}
+
GENERATOR(order_gen_any) {
GEN ord = ellff_get_card(curve->curve);
if (isclone(ord)) {