aboutsummaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
authorJ08nY2018-03-03 01:02:08 +0100
committerJ08nY2018-03-03 01:02:08 +0100
commitac60f78a253efde94cab36264b0555b0691fdd8a (patch)
tree12ce2bfdee1f13f0b6e56a017c3c29979475fe02 /src/misc
parent40cbb213ac910ddcaf22a26a247d2a9eeddca1fc (diff)
downloadecgen-ac60f78a253efde94cab36264b0555b0691fdd8a.tar.gz
ecgen-ac60f78a253efde94cab36264b0555b0691fdd8a.tar.zst
ecgen-ac60f78a253efde94cab36264b0555b0691fdd8a.zip
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/config.h2
-rw-r--r--src/misc/types.h24
2 files changed, 17 insertions, 9 deletions
diff --git a/src/misc/config.h b/src/misc/config.h
index 9a8f8af..ab5b0ba 100644
--- a/src/misc/config.h
+++ b/src/misc/config.h
@@ -71,7 +71,7 @@ typedef struct {
long koblitz_value;
/** @brief Whether the curves should have a bound on the cofactor value. */
bool cofactor;
- long cofactor_bound;
+ long cofactor_value;
/** @brief What seed algorithm, if any, to use to generate the curves. */
seed_e seed_algo;
/** @brief What seed to use, if any, to generate the curves. */
diff --git a/src/misc/types.h b/src/misc/types.h
index 1e74e04..f2e5ae2 100644
--- a/src/misc/types.h
+++ b/src/misc/types.h
@@ -67,6 +67,18 @@ typedef struct {
} point_t;
/**
+ * @brief A subgroup type.
+ * @param generator a point generating the subgroup
+ * @param npoints number of points stored in the subgroup
+ * @param points the stored points
+ */
+typedef struct {
+ point_t *generator;
+ size_t npoints;
+ point_t **points;
+} subgroup_t;
+
+/**
* @brief A curve type.
* @param seed a seed_t
* @param field a t_INT or t_FFELT
@@ -75,9 +87,7 @@ typedef struct {
* @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
+ * @param ngens number of generators saved in the curve type
*/
typedef struct {
seed_t *seed;
@@ -86,10 +96,8 @@ typedef struct {
GEN b;
GEN curve;
GEN order;
- point_t **generators;
+ subgroup_t **generators;
size_t ngens;
- point_t **points;
- size_t npoints;
} curve_t;
/**
@@ -126,7 +134,7 @@ typedef struct {
* @return state diff
*/
#define GENERATOR(gen_name) \
- int gen_name(curve_t *curve, arg_t *args, offset_e state)
+ int gen_name(curve_t *curve, arg_t *args, offset_e state)
typedef GENERATOR((*gen_f));
@@ -138,7 +146,7 @@ typedef GENERATOR((*gen_f));
* @return
*/
#define UNROLL(unroll_name) \
- int unroll_name(curve_t *curve, pari_sp from, pari_sp to)
+ int unroll_name(curve_t *curve, pari_sp from, pari_sp to)
typedef UNROLL((*unroll_f));