diff options
| author | J08nY | 2021-01-07 22:03:08 +0100 |
|---|---|---|
| committer | J08nY | 2021-01-07 22:03:08 +0100 |
| commit | 60a98f1917dd3f882d822c8546d0909ae17b6359 (patch) | |
| tree | b175d5be6d615ba07ae2168004cfb43cff8b69cc | |
| parent | 0b684e0e1d682d32ebdf3d664488214899e70c66 (diff) | |
| download | ecgen-60a98f1917dd3f882d822c8546d0909ae17b6359.tar.gz ecgen-60a98f1917dd3f882d822c8546d0909ae17b6359.tar.zst ecgen-60a98f1917dd3f882d822c8546d0909ae17b6359.zip | |
| -rw-r--r-- | src/gen/field.c | 1 | ||||
| -rw-r--r-- | src/misc/compat.h | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/gen/field.c b/src/gen/field.c index 7780406..3c93880 100644 --- a/src/gen/field.c +++ b/src/gen/field.c @@ -6,6 +6,7 @@ #include "io/input.h" #include "io/output.h" #include "math/poly.h" +#include "misc/compat.h" static GEN field_primer(unsigned long bits) { return random_prime(bits); } diff --git a/src/misc/compat.h b/src/misc/compat.h new file mode 100644 index 0000000..624d13f --- /dev/null +++ b/src/misc/compat.h @@ -0,0 +1,21 @@ +/* + * ecgen, tool for generating Elliptic curve domain parameters + * Copyright (C) 2021 J08nY + */ +/** + * @file compat.h + */ +#ifndef ECGEN_MISC_COMPAT_H +#define ECGEN_MISC_COMPAT_H + +#define PARI_VERSION_PATCH (PARI_VERSION_CODE & 0xff) +#define PARI_VERSION_MINOR (((PARI_VERSION_CODE) >> 8) & 0xff) +#define PARI_VERSION_MAJOR (PARI_VERSION_CODE >> 16) + +#if !(((PARI_VERSION_MAJOR == 2) && (PARI_VERSION_MINOR == 12) && (PARI_VERSION_PATCH >= 2)) || ((PARI_VERSION_MAJOR >= 2) && (PARI_VERSION_MINOR >= 12))) +// pari < 2.12.2 +#define polisirreducible isirreducible +#endif + + +#endif // ECGEN_MISC_COMPAT_H |
