aboutsummaryrefslogtreecommitdiff
path: root/src/math/poly.h
diff options
context:
space:
mode:
authorJ08nY2017-02-09 04:07:37 +0100
committerJ08nY2017-02-09 04:07:37 +0100
commit79b29481b1c4d13063dd8b6ee6a1d0d70a54faab (patch)
tree007da84bc4133c656f2f66df541f74c6b55bfb11 /src/math/poly.h
parent0b5d1cca9c78869c6cffa2932297c1d70ba142e2 (diff)
downloadecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.gz
ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.zst
ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.zip
Seperated different generation methods into modules.
- Added Koblitz curve generation.
Diffstat (limited to 'src/math/poly.h')
-rw-r--r--src/math/poly.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/math/poly.h b/src/math/poly.h
new file mode 100644
index 0000000..990c818
--- /dev/null
+++ b/src/math/poly.h
@@ -0,0 +1,45 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+#ifndef ECGEN_POLY_H
+#define ECGEN_POLY_H
+
+#include <pari/pari.h>
+#include <stdbool.h>
+
+typedef struct polynomial {
+ int m;
+ int e1;
+ int e2;
+ int e3;
+} polynomial_t;
+
+/**
+ *
+ * @param m
+ * @return
+ */
+bool poly_exists(long m);
+/**
+ *
+ * @param m
+ * @return
+ */
+polynomial_t *poly_find(long m);
+
+/**
+ *
+ * @param m
+ * @return
+ */
+GEN poly_find_gen(long m);
+
+/**
+ *
+ * @param polynomial
+ * @return
+ */
+GEN poly_gen(polynomial_t *polynomial);
+
+#endif // ECGEN_POLY_H