diff options
| author | J08nY | 2017-02-16 21:31:50 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-16 21:31:50 +0100 |
| commit | 7ae0d913d7bbfb286aaa9a5c9984e9bd7eb81df2 (patch) | |
| tree | b0f2d97310b9d0a3e4ba2e0a1cfbcf31d608383e /src/math/equation.h | |
| parent | 5d9d12811441930169b0517318dcf21c51b72e2d (diff) | |
| download | ecgen-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/equation.h')
| -rw-r--r-- | src/math/equation.h | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/src/math/equation.h b/src/math/equation.h index 76b5e06..4e0202e 100644 --- a/src/math/equation.h +++ b/src/math/equation.h @@ -19,10 +19,10 @@ * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int a_random(curve_t *curve, config_t *config, ...); +int a_random(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -30,10 +30,21 @@ int a_random(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int a_input(curve_t *curve, config_t *config, ...); +int a_input(curve_t *curve, config_t *config, arg_t *args); + +/** + * GENERATOR(gen_t) + * Creates a parameter by reading once from input. + * + * @param curve + * @param config + * @param args + * @return + */ +int a_once(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -41,10 +52,10 @@ int a_input(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int a_zero(curve_t *curve, config_t *config, ...); +int a_zero(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -52,12 +63,12 @@ int a_zero(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int a_one(curve_t *curve, config_t *config, ...); +int a_one(curve_t *curve, config_t *config, arg_t *args); -int a_seed(curve_t *curve, config_t *config, ...); +int a_seed(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -66,10 +77,10 @@ int a_seed(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int b_random(curve_t *curve, config_t *config, ...); +int b_random(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -77,10 +88,21 @@ int b_random(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int b_input(curve_t *curve, config_t *config, ...); +int b_input(curve_t *curve, config_t *config, arg_t *args); + +/** + * GENERATOR(gen_t) + * Creates b parameter by reading once from input. + * + * @param curve + * @param config + * @param args + * @return + */ +int b_once(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -88,10 +110,10 @@ int b_input(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int b_zero(curve_t *curve, config_t *config, ...); +int b_zero(curve_t *curve, config_t *config, arg_t *args); /** * GENERATOR(gen_t) @@ -99,11 +121,11 @@ int b_zero(curve_t *curve, config_t *config, ...); * * @param curve * @param config - * @param ... + * @param args * @return state diff */ -int b_one(curve_t *curve, config_t *config, ...); +int b_one(curve_t *curve, config_t *config, arg_t *args); -int b_seed(curve_t *curve, config_t *config, ...); +int b_seed(curve_t *curve, config_t *config, arg_t *args); #endif // ECGEN_EQUATION_H |
