diff options
Diffstat (limited to 'src/math/field.c')
| -rw-r--r-- | src/math/field.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/math/field.c b/src/math/field.c index 09b9a51..983aa09 100644 --- a/src/math/field.c +++ b/src/math/field.c @@ -75,7 +75,11 @@ int field_input(curve_t *curve, config_t *config, arg_t *args) { gel(v, 1) = gen_1; GEN poly = gmul(gtopolyrev(v, -1), gmodulss(1, 2)); - // TODO check irreducibility here + if (!isirreducible(poly)) { + fprintf(stderr, "Polynomial is reducible.\n"); + avma = ltop; + return 0; + } GEN field = gerepilecopy(ltop, ffgen(poly, -1)); curve->field = field; |
