aboutsummaryrefslogtreecommitdiff
path: root/src/invalid/invalid_thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/invalid/invalid_thread.h')
-rw-r--r--src/invalid/invalid_thread.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/invalid/invalid_thread.h b/src/invalid/invalid_thread.h
new file mode 100644
index 0000000..1ee4cf7
--- /dev/null
+++ b/src/invalid/invalid_thread.h
@@ -0,0 +1,38 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+/**
+ * @file invalid_thread.h
+ */
+#ifndef ECGEN_INVALID_THREAD_H
+#define ECGEN_INVALID_THREAD_H
+
+#include <pari/pari.h>
+#include <pthread.h>
+#include "math/types.h"
+
+typedef enum { STATE_FREE, STATE_GENERATING, STATE_GENERATED } state_e;
+
+typedef struct {
+ curve_t *original_curve;
+ size_t nprimes;
+ pari_ulong *primes;
+ state_e *states;
+ curve_t **curves;
+ size_t *generated;
+ pthread_mutex_t *mutex_state;
+ pthread_mutex_t *mutex_curves;
+ pthread_cond_t *cond_generated;
+ config_t *cfg;
+ gen_t *gens;
+} thread_t;
+
+/**
+ *
+ * @param arg
+ * @return
+ */
+void *invalid_thread(void *arg);
+
+#endif // ECGEN_INVALID_THREAD_H