diff options
| author | J08nY | 2017-02-28 17:00:39 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-28 17:00:39 +0100 |
| commit | 2cbd1a82a756f15cfb987713bce6ac02dad64623 (patch) | |
| tree | 01dac90a9f27645ccdb1d1d42c6facfb257915c0 /src/math/field.c | |
| parent | 55fd80d2563f461e96dfd680730a2bc416ca5f98 (diff) | |
| download | ecgen-2cbd1a82a756f15cfb987713bce6ac02dad64623.tar.gz ecgen-2cbd1a82a756f15cfb987713bce6ac02dad64623.tar.zst ecgen-2cbd1a82a756f15cfb987713bce6ac02dad64623.zip | |
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; |
