aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exhaustive/ansi.c4
-rw-r--r--src/exhaustive/exhaustive.c5
-rw-r--r--src/gen/equation.c4
-rw-r--r--src/gen/field.c2
-rw-r--r--src/misc/types.h3
5 files changed, 10 insertions, 8 deletions
diff --git a/src/exhaustive/ansi.c b/src/exhaustive/ansi.c
index 51d20e5..d18ea02 100644
--- a/src/exhaustive/ansi.c
+++ b/src/exhaustive/ansi.c
@@ -183,9 +183,9 @@ static GENERATOR(ansi_gen_equation_f2m) {
GENERATOR(ansi_gen_equation) {
switch (cfg->field) {
case FIELD_PRIME:
- return ansi_gen_equation_fp(curve, cfg, args);
+ return ansi_gen_equation_fp(curve, cfg, args, state);
case FIELD_BINARY:
- return ansi_gen_equation_f2m(curve, cfg, args);
+ return ansi_gen_equation_f2m(curve, cfg, args, state);
default:
pari_err_BUG("Field not prime or binary?");
return INT_MIN; /* NOT REACHABLE */
diff --git a/src/exhaustive/exhaustive.c b/src/exhaustive/exhaustive.c
index 623396e..8103f3b 100644
--- a/src/exhaustive/exhaustive.c
+++ b/src/exhaustive/exhaustive.c
@@ -230,14 +230,15 @@ int exhaustive_gen_retry(curve_t *curve, const config_t *cfg,
arg_t *arg = argss ? argss[state] : NULL;
- int diff = generators[state](curve, cfg, arg);
+ int diff = generators[state](curve, cfg, arg, (offset_e)state);
int new_state = state + diff;
if (new_state < start_offset) new_state = start_offset;
if (diff > 0 && validators && validators[state]) {
check_t *validator = validators[state];
for (size_t i = 0; i < validator->nchecks; ++i) {
- int new_diff = validator->checks[i](curve, cfg, arg);
+ int new_diff = validator->checks[i](curve, cfg, arg,
+ (offset_e)state);
if (new_diff <= 0) {
diff = new_diff;
break;
diff --git a/src/gen/equation.c b/src/gen/equation.c
index 76d0498..9d85c13 100644
--- a/src/gen/equation.c
+++ b/src/gen/equation.c
@@ -36,7 +36,7 @@ GENERATOR(a_gen_once) {
return 1;
}
- int inp = a_gen_input(curve, cfg, args);
+ int inp = a_gen_input(curve, cfg, args, state);
if (inp > 0) {
a = gclone(curve->a);
curve_a = curve;
@@ -86,7 +86,7 @@ GENERATOR(b_gen_once) {
return 1;
}
- int inp = b_gen_input(curve, cfg, args);
+ int inp = b_gen_input(curve, cfg, args, state);
if (inp > 0) {
b = gclone(curve->b);
curve_b = curve;
diff --git a/src/gen/field.c b/src/gen/field.c
index 9a908cc..898af9e 100644
--- a/src/gen/field.c
+++ b/src/gen/field.c
@@ -104,7 +104,7 @@ GENERATOR(field_gen_once) {
return 1;
}
- int inp = field_gen_input(curve, cfg, args);
+ int inp = field_gen_input(curve, cfg, args, state);
if (inp > 0) {
field = gclone(curve->field);
curve_field = curve;
diff --git a/src/misc/types.h b/src/misc/types.h
index 103cf8a..74a0aa2 100644
--- a/src/misc/types.h
+++ b/src/misc/types.h
@@ -116,10 +116,11 @@ typedef struct {
* @param curve A curve_t being generated
* @param cfg An application config
* @param args Current optional generator argument
+ * @param state The current generation state
* @return state diff
*/
#define GENERATOR(gen_name) \
- int gen_name(curve_t *curve, const config_t *cfg, arg_t *args)
+ int gen_name(curve_t *curve, const config_t *cfg, arg_t *args, offset_e state)
typedef GENERATOR((*gen_f));