summaryrefslogtreecommitdiff
path: root/src/poly.h
diff options
context:
space:
mode:
authorJ08nY2017-02-05 03:59:52 +0100
committerJ08nY2017-02-05 03:59:52 +0100
commit763fc80153c5e9287f1b0f0609b11fb4f50c90ab (patch)
tree5cd6e7acc4512cca65bcc16a74f3b63879b2d3bc /src/poly.h
parent3d9bf583ccc5eea61c5f78f52d1e2073daee924c (diff)
downloadecgen-0.2.0.tar.gz
ecgen-0.2.0.tar.zst
ecgen-0.2.0.zip
Diffstat (limited to 'src/poly.h')
-rw-r--r--src/poly.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/poly.h b/src/poly.h
new file mode 100644
index 0000000..2bb5c96
--- /dev/null
+++ b/src/poly.h
@@ -0,0 +1,48 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+#ifndef ECGEN_POLY_H
+#define ECGEN_POLY_H
+
+#include <stdbool.h>
+#include "gp.h"
+
+typedef struct polynomial {
+ int m;
+ int e1;
+ int e2;
+ int e3;
+} polynomial_t;
+
+extern polynomial_t ansi_trinomials[];
+extern polynomial_t ansi_pentanomials[];
+
+/**
+ *
+ * @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