diff options
Diffstat (limited to 'src/math/equation.c')
| -rw-r--r-- | src/math/equation.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/math/equation.c b/src/math/equation.c index d60a8cd..4e2e0ec 100644 --- a/src/math/equation.c +++ b/src/math/equation.c @@ -3,16 +3,15 @@ * Copyright (C) 2017 J08nY */ #include "equation.h" -#include "io/cli.h" #include "io/input.h" #include "math/field.h" -int a_random(curve_t *curve, config_t *cfg, arg_t *args) { +int a_random(curve_t *curve, const config_t *cfg, arg_t *args) { curve->a = genrand(curve->field); return 1; } -int a_input(curve_t *curve, config_t *cfg, arg_t *args) { +int a_input(curve_t *curve, const config_t *cfg, arg_t *args) { pari_sp ltop = avma; GEN inp = input_int("a:", cfg->bits); if (gequalm1(inp)) { @@ -31,7 +30,7 @@ int a_input(curve_t *curve, config_t *cfg, arg_t *args) { static GEN a = NULL; static curve_t *curve_a = NULL; -int a_once(curve_t *curve, config_t *cfg, arg_t *args) { +int a_once(curve_t *curve, const config_t *cfg, arg_t *args) { if (a && curve_a == curve) { curve->a = gcopy(a); return 1; @@ -47,27 +46,27 @@ int a_once(curve_t *curve, config_t *cfg, arg_t *args) { } } -int a_zero(curve_t *curve, config_t *cfg, arg_t *args) { +int a_zero(curve_t *curve, const config_t *cfg, arg_t *args) { curve->a = gen_0; return 1; } -int a_one(curve_t *curve, config_t *cfg, arg_t *args) { +int a_one(curve_t *curve, const config_t *cfg, arg_t *args) { curve->a = gen_1; return 1; } -int a_seed(curve_t *curve, config_t *cfg, arg_t *args) { +int a_seed(curve_t *curve, const config_t *cfg, arg_t *args) { // TODO implement return INT_MIN; } -int b_random(curve_t *curve, config_t *cfg, arg_t *args) { +int b_random(curve_t *curve, const config_t *cfg, arg_t *args) { curve->b = genrand(curve->field); return 1; } -int b_input(curve_t *curve, config_t *cfg, arg_t *args) { +int b_input(curve_t *curve, const config_t *cfg, arg_t *args) { pari_sp ltop = avma; GEN inp = input_int("b:", cfg->bits); if (gequalm1(inp)) { @@ -86,7 +85,7 @@ int b_input(curve_t *curve, config_t *cfg, arg_t *args) { static GEN b = NULL; static curve_t *curve_b = NULL; -int b_once(curve_t *curve, config_t *cfg, arg_t *args) { +int b_once(curve_t *curve, const config_t *cfg, arg_t *args) { if (b && curve_b == curve) { curve->b = gcopy(b); return 1; @@ -102,17 +101,17 @@ int b_once(curve_t *curve, config_t *cfg, arg_t *args) { } } -int b_zero(curve_t *curve, config_t *cfg, arg_t *args) { +int b_zero(curve_t *curve, const config_t *cfg, arg_t *args) { curve->b = gen_0; return 1; } -int b_one(curve_t *curve, config_t *cfg, arg_t *args) { +int b_one(curve_t *curve, const config_t *cfg, arg_t *args) { curve->b = gen_1; return 1; } -int b_seed(curve_t *curve, config_t *cfg, arg_t *args) { +int b_seed(curve_t *curve, const config_t *cfg, arg_t *args) { // TODO implement return INT_MIN; } |
