aboutsummaryrefslogtreecommitdiff
path: root/src/math/point.h
diff options
context:
space:
mode:
authorJ08nY2017-02-16 21:31:50 +0100
committerJ08nY2017-02-16 21:31:50 +0100
commit7ae0d913d7bbfb286aaa9a5c9984e9bd7eb81df2 (patch)
treeb0f2d97310b9d0a3e4ba2e0a1cfbcf31d608383e /src/math/point.h
parent5d9d12811441930169b0517318dcf21c51b72e2d (diff)
downloadecgen-7ae0d913d7bbfb286aaa9a5c9984e9bd7eb81df2.tar.gz
ecgen-7ae0d913d7bbfb286aaa9a5c9984e9bd7eb81df2.tar.zst
ecgen-7ae0d913d7bbfb286aaa9a5c9984e9bd7eb81df2.zip
Optimized invalid curve generation, added optional args to gen_t
- Optimized invalid curve generation - Invalid curve generation for secp256r1 now takes around 90minutes instead of 5hours as before - Optimized prime point generation(if only some small prime order points are needed -> points_primet) - Added a_once and b_once that prompt for parameter input and then set the input parameter repeatedly - Added optional args to gen_t functions - Integer input now ignores whitespace and doesnt errorneously prompt stdout when reading from file - Specified C standard(C11) + feature macros in code.
Diffstat (limited to 'src/math/point.h')
-rw-r--r--src/math/point.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/math/point.h b/src/math/point.h
index bd7d2dd..fe9aeb4 100644
--- a/src/math/point.h
+++ b/src/math/point.h
@@ -54,24 +54,49 @@ point_t **points_copy(point_t **src, point_t **dest, size_t num);
void points_free(point_t ***point);
/**
+ *
+ * @param points
+ * @param npoints
+ */
+void points_free_deep(point_t ***points, size_t npoints);
+
+/**
+ * GENERATOR(gen_t)
+ *
+ * @param curve
+ * @param config
+ * @param args unused
+ * @return state diff
+ */
+int point_random(curve_t *curve, config_t *config, arg_t *args);
+
+/**
* GENERATOR(gen_t)
*
* @param curve
* @param config
- * @param ... unused
+ * @param args size_t number of points to generate
* @return state diff
*/
-int point_random(curve_t *curve, config_t *config, ...);
+int points_random(curve_t *curve, config_t *config, arg_t *args);
/**
* GENERATOR(gen_t)
+ * Generates prime order points using trial division.
+ * The supplied arg is of format:
+ *
+ * pari_ulong *args->args primes
+ * size_t args->nargs length of primes
+ *
+ * Assumes the primes divide curve order, thus that points with all
+ * prime orders specified exist.
*
* @param curve
* @param config
- * @param ... size_t number of points to generate
+ * @param args
* @return state diff
*/
-int points_random(curve_t *curve, config_t *config, ...);
+int points_primet(curve_t *curve, config_t *config, arg_t *args);
/**
* GENERATOR(gen_t)
@@ -82,10 +107,10 @@ int points_random(curve_t *curve, config_t *config, ...);
*
* @param curve
* @param config
- * @param ...
+ * @param args
* @return state diff
*/
-int points_prime(curve_t *curve, config_t *config, ...);
+int points_prime(curve_t *curve, config_t *config, arg_t *args);
/**
* GENERATOR(gen_t)
@@ -94,9 +119,9 @@ int points_prime(curve_t *curve, config_t *config, ...);
*
* @param curve
* @param config
- * @param ... unused
+ * @param args unused
* @return state diff
*/
-int points_generators(curve_t *curve, config_t *config, ...);
+int points_generators(curve_t *curve, config_t *config, arg_t *args);
#endif // ECGEN_POINT_H