aboutsummaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/compat.h21
1 files changed, 21 insertions, 0 deletions
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