aboutsummaryrefslogtreecommitdiff
path: root/src/math/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/types.h')
-rw-r--r--src/math/types.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/math/types.h b/src/math/types.h
new file mode 100644
index 0000000..8185078
--- /dev/null
+++ b/src/math/types.h
@@ -0,0 +1,44 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+#ifndef ECGEN_TYPES_H
+#define ECGEN_TYPES_H
+
+#include <pari/pari.h>
+#include "io/cli.h"
+
+typedef struct seed { GEN seed; } seed_t;
+
+typedef struct point_t {
+ GEN point;
+ GEN order;
+} point_t;
+
+typedef struct curve {
+ seed_t *seed;
+ GEN field;
+ GEN a;
+ GEN b;
+ GEN curve;
+ GEN order;
+ point_t **points;
+ size_t npoints;
+} curve_t;
+
+enum curve_offset {
+ OFFSET_SEED,
+ OFFSET_FIELD,
+ OFFSET_A,
+ OFFSET_B,
+ OFFSET_CURVE,
+ OFFSET_ORDER,
+ OFFSET_POINTS,
+ OFFSET_END
+};
+
+typedef int (*gen_t)(curve_t *, config_t *, ...);
+
+int gen_skip(curve_t *curve, config_t *config, ...);
+
+#endif // ECGEN_TYPES_H