aboutsummaryrefslogtreecommitdiff
path: root/src/math/field.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/field.h
parent0b5d1cca9c78869c6cffa2932297c1d70ba142e2 (diff)
downloadecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.gz
ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.zst
ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.zip
Diffstat (limited to 'src/math/field.h')
-rw-r--r--src/math/field.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/math/field.h b/src/math/field.h
new file mode 100644
index 0000000..9fde4e5
--- /dev/null
+++ b/src/math/field.h
@@ -0,0 +1,47 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+#ifndef ECGEN_FIELD_H
+#define ECGEN_FIELD_H
+
+#include "io/cli.h"
+#include "types.h"
+
+/**
+ *
+ * @param curve
+ * @param config
+ * @return
+ */
+int field_random(curve_t *curve, config_t *config, ...);
+
+/**
+ *
+ * @param curve
+ * @param config
+ * @return
+ */
+int field_input(curve_t *curve, config_t *config, ...);
+
+/**
+ * Extract a field representation from a field.
+ * - char(field) == 2:
+ * returns the vector of powers of middle coefficients of the reduction
+ * polynomial.
+ * - char(field) != 2:
+ * returns the field characteristic(p).-
+ *
+ * @param field
+ * @return field representation
+ */
+GEN field_params(GEN field);
+
+/**
+ *
+ * @param element
+ * @return
+ */
+GEN field_elementi(GEN element);
+
+#endif // ECGEN_FIELD_H