aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-04-27 16:36:08 +0200
committerJ08nY2017-04-27 16:36:08 +0200
commit67132e9095402696a892f7114a2d477c5b559fdd (patch)
tree4b1784c0cd56a4525748bd277cdb80036e447d8f
parent52f205c0fb76ec39a12cbd8a68676485898856ea (diff)
downloadecgen-67132e9095402696a892f7114a2d477c5b559fdd.tar.gz
ecgen-67132e9095402696a892f7114a2d477c5b559fdd.tar.zst
ecgen-67132e9095402696a892f7114a2d477c5b559fdd.zip
-rw-r--r--Doxyfile2
-rw-r--r--src/ecgen.c4
-rw-r--r--src/exhaustive/exhaustive.c1
-rw-r--r--src/exhaustive/seed.h2
-rw-r--r--src/invalid/invalid.h1
-rw-r--r--src/invalid/invalid_thread.h1
-rw-r--r--src/io/cli.c1
-rw-r--r--src/io/output.h70
-rw-r--r--src/math/curve.c1
-rw-r--r--src/math/curve.h1
-rw-r--r--src/math/equation.h1
-rw-r--r--src/math/field.h1
-rw-r--r--src/math/gens.c1
-rw-r--r--src/math/point.c1
-rw-r--r--src/math/point.h1
-rw-r--r--src/math/types.h19
16 files changed, 71 insertions, 37 deletions
diff --git a/Doxyfile b/Doxyfile
index b2c61ab..9ea4fd5 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = ./doc
+OUTPUT_DIRECTORY = ./docs
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
diff --git a/src/ecgen.c b/src/ecgen.c
index f482fcd..8ca63ca 100644
--- a/src/ecgen.c
+++ b/src/ecgen.c
@@ -27,8 +27,6 @@
#include "cm/cm.h"
#include "exhaustive/exhaustive.h"
#include "invalid/invalid.h"
-#include "io/cli.h"
-#include "io/config.h"
#include "io/input.h"
#include "io/output.h"
@@ -125,7 +123,7 @@ int quit(int status) {
* - Can generate curves repeatedly until one satisfies requested
* properties:
* - -p / --prime generates curves until a prime order curve is found.
- * - -k / --koblitz generates a curve with fixed A = 0 parameter.
+ * - -K / --koblitz generates a curve with fixed A = 0 parameter.
*
*/
int main(int argc, char *argv[]) {
diff --git a/src/exhaustive/exhaustive.c b/src/exhaustive/exhaustive.c
index 8c1e0b9..e0fde07 100644
--- a/src/exhaustive/exhaustive.c
+++ b/src/exhaustive/exhaustive.c
@@ -3,7 +3,6 @@
* Copyright (C) 2017 J08nY
*/
#include "exhaustive.h"
-#include <io/config.h>
#include "io/output.h"
#include "math/arg.h"
#include "math/curve.h"
diff --git a/src/exhaustive/seed.h b/src/exhaustive/seed.h
index d4236ce..89c7e07 100644
--- a/src/exhaustive/seed.h
+++ b/src/exhaustive/seed.h
@@ -8,7 +8,7 @@
#ifndef ECGEN_SEED_H
#define ECGEN_SEED_H
-#include "io/cli.h"
+#include "io/input.h"
#include "math/types.h"
/**
diff --git a/src/invalid/invalid.h b/src/invalid/invalid.h
index 43de25a..035692c 100644
--- a/src/invalid/invalid.h
+++ b/src/invalid/invalid.h
@@ -8,7 +8,6 @@
#ifndef ECGEN_INVALID_H
#define ECGEN_INVALID_H
-#include "io/cli.h"
#include "io/config.h"
/**
diff --git a/src/invalid/invalid_thread.h b/src/invalid/invalid_thread.h
index d8c1b76..2c6275f 100644
--- a/src/invalid/invalid_thread.h
+++ b/src/invalid/invalid_thread.h
@@ -8,7 +8,6 @@
#ifndef ECGEN_INVALID_THREAD_H
#define ECGEN_INVALID_THREAD_H
-#include <pari/pari.h>
#include <pthread.h>
#include "math/types.h"
diff --git a/src/io/cli.c b/src/io/cli.c
index e7de595..21eeb56 100644
--- a/src/io/cli.c
+++ b/src/io/cli.c
@@ -6,7 +6,6 @@
#include <string.h>
#include <unistd.h>
#include "config.h"
-#include "io/config.h"
char doc[] =
"ecgen, tool for generating Elliptic curve domain parameters.\v(C) 2017 "
diff --git a/src/io/output.h b/src/io/output.h
index 52719c3..ef36f99 100644
--- a/src/io/output.h
+++ b/src/io/output.h
@@ -13,35 +13,69 @@
#include "math/types.h"
/**
- *
+ * @brief Output curve to a pari_malloc'ed string in CSV format.
* @param curve
* @param config
* @return
*/
char *output_scsv(curve_t *curve, const config_t *cfg);
+/**
+ * @brief Output CSV separator(newline) to a pari_malloc'ed string in CSV
+ * format.
+ * @param cfg
+ * @return
+ */
char *output_scsv_separator(const config_t *cfg);
+/**
+ * @brief Output CSV output header to a pari_malloc'ed string in CSV format.
+ * @param cfg
+ * @return
+ */
char *output_scsv_begin(const config_t *cfg);
+/**
+ * @brief Output CSV output footer to a pari_malloc'ed string in CSV format.
+ * @param cfg
+ * @return
+ */
char *output_scsv_end(const config_t *cfg);
/**
- *
+ * @brief Output curve to a pari_malloc'ed string in JSON format.
* @param curve
* @param config
* @return
*/
char *output_sjson(curve_t *curve, const config_t *cfg);
+/**
+ * @brief Output JSON separator(a ",\n") to a pari_malloc'ed string in CSV
+ * format.
+ * @param cfg
+ * @return
+ */
char *output_sjson_separator(const config_t *cfg);
+/**
+ * @brief Output JSON output header(a "[") to a pari_malloc'ed string in CSV
+ * format.
+ * @param cfg
+ * @return
+ */
char *output_sjson_begin(const config_t *cfg);
+/**
+ * @brief Output JSON output footer(a "]") to a pari_malloc'ed string in CSV
+ * format.
+ * @param cfg
+ * @return
+ */
char *output_sjson_end(const config_t *cfg);
/**
- *
+ * @brief Output curve to a pari_malloc'ed string in configured format.
* @param curve
* @param config
* @return
@@ -49,7 +83,7 @@ char *output_sjson_end(const config_t *cfg);
char *(*output_s)(curve_t *curve, const config_t *cfg);
/**
- *
+ * @brief Output curve to a FILE *out in configured format.
* @param out
* @param curve
* @param config
@@ -57,90 +91,90 @@ char *(*output_s)(curve_t *curve, const config_t *cfg);
void output_f(FILE *out, curve_t *curve, const config_t *cfg);
/**
- *
+ * @brief Output curve to configured output in configured format.
* @param curve
* @param config
*/
void output_o(curve_t *curve, const config_t *cfg);
/**
- * @brief
+ * @brief Output separator to a pari_malloc'ed string in configured format.
* @param cfg
* @return
*/
char *(*output_s_separator)(const config_t *cfg);
/**
- * @brief
+ * @brief Output separator to a FILE *out in configured format.
* @param out
* @param cfg
*/
void output_f_separator(FILE *out, const config_t *cfg);
/**
- * @brief
+ * @brief Output separator to configured output in configured format.
* @param cfg
*/
void output_o_separator(const config_t *cfg);
/**
- * @brief
+ * @brief Output header to a pari_malloc'ed string in configured format.
* @param cfg
* @return
*/
char *(*output_s_begin)(const config_t *cfg);
/**
- * @brief
+ * @brief Output header to a FILE *out in configured format.
* @param out
* @param cfg
*/
void output_f_begin(FILE *out, const config_t *cfg);
/**
- * @brief
+ * @brief Output header to configured output in configured format.
* @param cfg
*/
void output_o_begin(const config_t *cfg);
/**
- * @brief
+ * @brief Output footer to a pari_malloc'ed string in configured format.
* @param cfg
* @return
*/
char *(*output_s_end)(const config_t *cfg);
/**
- * @brief
+ * @brief Output footer to a FILE *out in configured format.
* @param out
* @param cfg
*/
void output_f_end(FILE *out, const config_t *cfg);
/**
- * @brief
+ * @brief Output header to configured output in configured format.
* @param cfg
*/
void output_o_end(const config_t *cfg);
/**
- *
+ * @brief Configured output FILE*.
*/
extern FILE *out;
/**
- *
+ * @brief Configured verbose output FILE*.
*/
extern FILE *verbose;
/**
- *
+ * @brief Initialize output based on cfg.
* @param cfg
*/
void output_init(const config_t *cfg);
/**
- *
+ * @brief Deinitialize output.
*/
void output_quit(void);
diff --git a/src/math/curve.c b/src/math/curve.c
index 32c4b84..00e65f0 100644
--- a/src/math/curve.c
+++ b/src/math/curve.c
@@ -5,7 +5,6 @@
#include "curve.h"
#include "exhaustive/seed.h"
#include "field.h"
-#include "io/output.h"
#include "point.h"
curve_t *curve_new(void) {
diff --git a/src/math/curve.h b/src/math/curve.h
index d1aaf27..c250040 100644
--- a/src/math/curve.h
+++ b/src/math/curve.h
@@ -9,7 +9,6 @@
#define ECGEN_CURVE_H
#include <pari/pari.h>
-#include "io/cli.h"
#include "types.h"
/**
diff --git a/src/math/equation.h b/src/math/equation.h
index 1f80f21..858d318 100644
--- a/src/math/equation.h
+++ b/src/math/equation.h
@@ -8,7 +8,6 @@
#ifndef ECGEN_EQUATION_H
#define ECGEN_EQUATION_H
-#include "io/cli.h"
#include "types.h"
/**
diff --git a/src/math/field.h b/src/math/field.h
index b1dc4f3..0bd79df 100644
--- a/src/math/field.h
+++ b/src/math/field.h
@@ -8,7 +8,6 @@
#ifndef ECGEN_FIELD_H
#define ECGEN_FIELD_H
-#include "io/cli.h"
#include "types.h"
/**
diff --git a/src/math/gens.c b/src/math/gens.c
index ef47525..5965f9a 100644
--- a/src/math/gens.c
+++ b/src/math/gens.c
@@ -3,7 +3,6 @@
* Copyright (C) 2017 J08nY
*/
#include "gens.h"
-#include "io/output.h"
#include "point.h"
static int gens_put(curve_t *curve, GEN generators, long len) {
diff --git a/src/math/point.c b/src/math/point.c
index 5233b6d..d8a9d8d 100644
--- a/src/math/point.c
+++ b/src/math/point.c
@@ -3,7 +3,6 @@
* Copyright (C) 2017 J08nY
*/
#include "point.h"
-#include "io/output.h"
point_t *point_new(void) {
point_t *point = pari_malloc(sizeof(point_t));
diff --git a/src/math/point.h b/src/math/point.h
index ef6facf..15c626b 100644
--- a/src/math/point.h
+++ b/src/math/point.h
@@ -8,7 +8,6 @@
#ifndef ECGEN_POINT_H
#define ECGEN_POINT_H
-#include <pari/pari.h>
#include "types.h"
/**
diff --git a/src/math/types.h b/src/math/types.h
index d6c0cca..96103e5 100644
--- a/src/math/types.h
+++ b/src/math/types.h
@@ -8,8 +8,8 @@
#ifndef ECGEN_TYPES_H
#define ECGEN_TYPES_H
+#include <limits.h>
#include <pari/pari.h>
-#include "io/cli.h"
#include "io/config.h"
/**
@@ -18,7 +18,10 @@
typedef struct { GEN seed; } seed_t;
/**
- * @brief
+ * @brief A point type.
+ * @param point a t_VEC with t_INTMOD or t_FFELT components [x,y]
+ * @param order a t_INT
+ * @param cofactor a t_INT
*/
typedef struct {
GEN point;
@@ -27,7 +30,17 @@ typedef struct {
} point_t;
/**
- * @brief
+ * @brief A curve type.
+ * @param seed a seed_t
+ * @param field a t_INT or t_FFELT
+ * @param a a t_INTMOD or t_FFELT a parameter
+ * @param b a t_INTMOD or t_FFELT b parameter
+ * @param curve a t_ELL, curve object
+ * @param order a t_INT, curve order
+ * @param generators generators saved
+ * @param ngens numver of generators saved in the curve type
+ * @param points points saved
+ * @param npoints number of points saved in the curve type
*/
typedef struct {
seed_t *seed;