aboutsummaryrefslogtreecommitdiff
path: root/src/gen
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen')
-rw-r--r--src/gen/gens.c13
-rw-r--r--src/gen/hex.c2
-rw-r--r--src/gen/metadata.c3
-rw-r--r--src/gen/order.c2
4 files changed, 14 insertions, 6 deletions
diff --git a/src/gen/gens.c b/src/gen/gens.c
index a743e79..329149a 100644
--- a/src/gen/gens.c
+++ b/src/gen/gens.c
@@ -5,9 +5,9 @@
#include "gens.h"
#include "exhaustive/arg.h"
#include "math/subgroup.h"
+#include "misc/compat.h"
#include "obj/point.h"
#include "obj/subgroup.h"
-#include "misc/compat.h"
static subgroup_t *gens_point(GEN point, const curve_t *curve) {
subgroup_t *sub = subgroup_new();
@@ -37,13 +37,20 @@ GENERATOR(gens_gen_any) {
GENERATOR(gens_gen_one) {
pari_sp ltop = avma;
+ GEN group = ellff_get_group(curve->curve);
+ debug_log("Group structure %Ps.", group);
+ long len = glength(group);
+ if (len == 2) {
+ avma = ltop;
+ return -5;
+ }
GEN generators = ellff_get_gens(curve->curve);
- long len = glength(generators);
+ len = glength(generators);
if (len == 2) {
avma = ltop;
return -5;
}
- return gens_put(curve, generators, len);
+ return gens_put(curve, gerepilecopy(ltop, generators), len);
}
GENERATOR(gens_gen_cofactor) {
diff --git a/src/gen/hex.c b/src/gen/hex.c
index 58250a0..559e86c 100644
--- a/src/gen/hex.c
+++ b/src/gen/hex.c
@@ -121,4 +121,4 @@ CHECK(hex_check_param) {
}
try_free(search_hex);
return result;
-} \ No newline at end of file
+}
diff --git a/src/gen/metadata.c b/src/gen/metadata.c
index b857ec7..7d455ef 100644
--- a/src/gen/metadata.c
+++ b/src/gen/metadata.c
@@ -28,7 +28,8 @@ GENERATOR(metadata_gen) {
GEN d_f = coredisc2(subii(sqri(frobenius), mulis(q, 4)));
cm_disc = gcopy(gel(d_f, 1));
conductor = gcopy(gel(d_f, 2));
- gerepileall(ltop, 6, &j, &disc, &embedding_degree, &frobenius, &cm_disc, &conductor);
+ gerepileall(ltop, 6, &j, &disc, &embedding_degree, &frobenius, &cm_disc,
+ &conductor);
} else if (typ(curve->field) == t_FFELT) {
cm_disc = NULL;
conductor = NULL;
diff --git a/src/gen/order.c b/src/gen/order.c
index a9d22b2..64ef665 100644
--- a/src/gen/order.c
+++ b/src/gen/order.c
@@ -158,4 +158,4 @@ CHECK(order_check_discriminant) {
}
avma = ltop;
return 1;
-} \ No newline at end of file
+}