From 651fc7ffe96ecf81418bedadcf38039cc8e06292 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 7 Dec 2022 14:46:04 +0100 Subject: Fix #17. --- src/gen/gens.c | 3 ++- src/misc/compat.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gen/gens.c b/src/gen/gens.c index 6e93f64..965a19e 100644 --- a/src/gen/gens.c +++ b/src/gen/gens.c @@ -7,6 +7,7 @@ #include "math/subgroup.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(); @@ -103,7 +104,7 @@ CHECK(gens_check_anomalous) { } GEN gens_get_embedding(GEN prime, GEN generator_order) { - return order(mkintmod(prime, generator_order)); + return znorder(mkintmod(prime, generator_order), NULL); } CHECK(gens_check_embedding) { diff --git a/src/misc/compat.h b/src/misc/compat.h index ba4a107..7e3d4e8 100644 --- a/src/misc/compat.h +++ b/src/misc/compat.h @@ -18,10 +18,12 @@ #define PARI_VERSION_LT(a,b,c) !(PARI_VERSION_GE(a,b,c)) #define PARI_VERSION_LE(a,b,c) !(PARI_VERSION_GT(a,b,c)) - #if PARI_VERSION_LT(2,12,1) #define polisirreducible isirreducible #endif +#if PARI_VERSION_LT(2,15,0) +#define znorder(x, o) order(x); +#endif #endif // ECGEN_MISC_COMPAT_H -- cgit v1.2.3-70-g09d2