diff options
| author | J08nY | 2017-10-08 20:00:10 +0200 |
|---|---|---|
| committer | J08nY | 2017-10-08 20:00:10 +0200 |
| commit | d06df483bc75871a3046885c41ae96751a32cec8 (patch) | |
| tree | 0d892e8387f581fa8b78ef9a1a61a9a9547e8887 | |
| parent | 39aa16cf47e7b85b936f56a3256c1b547ed1bb68 (diff) | |
| download | ecgen-d06df483bc75871a3046885c41ae96751a32cec8.tar.gz ecgen-d06df483bc75871a3046885c41ae96751a32cec8.tar.zst ecgen-d06df483bc75871a3046885c41ae96751a32cec8.zip | |
| -rw-r--r-- | src/exhaustive/anomalous.h | 2 | ||||
| -rw-r--r-- | src/exhaustive/exhaustive.h | 29 | ||||
| -rw-r--r-- | src/io/input.h | 18 | ||||
| -rw-r--r-- | src/io/output.h | 28 | ||||
| -rw-r--r-- | src/misc/config.h | 29 |
5 files changed, 55 insertions, 51 deletions
diff --git a/src/exhaustive/anomalous.h b/src/exhaustive/anomalous.h index c23490f..886ef62 100644 --- a/src/exhaustive/anomalous.h +++ b/src/exhaustive/anomalous.h @@ -13,7 +13,7 @@ #include "io/cli.h" #include "misc/types.h" -typedef struct disc_t { +typedef struct { GEN d; GEN j; GEN alpha; diff --git a/src/exhaustive/exhaustive.h b/src/exhaustive/exhaustive.h index ddc1ef6..8d11da2 100644 --- a/src/exhaustive/exhaustive.h +++ b/src/exhaustive/exhaustive.h @@ -5,8 +5,8 @@ /** * @file exhaustive.h */ -#ifndef ECGEN_GENERATORS_H -#define ECGEN_GENERATORS_H +#ifndef ECGEN_EXHAUSTIVE_H +#define ECGEN_EXHAUSTIVE_H #include "misc/types.h" @@ -22,34 +22,11 @@ typedef struct { /** * @brief - * @return - */ -exhaustive_t *exhaustive_new(void); - -/** - * @brief - * @param generators - * @param validators - * @param argss - * @param unrolls - * @return - */ -exhaustive_t *exhaustive_create(gen_f *generators, check_t **validators, - arg_t **argss, unroll_f *unrolls); - -/** - * @brief * @param setup */ void exhaustive_clear(exhaustive_t *setup); /** - * @brief - * @param setup - */ -void exhaustive_free(exhaustive_t **setup); - -/** * * @param unrolls * @param cfg @@ -90,4 +67,4 @@ int exhaustive_gen(curve_t *curve, const config_t *cfg, */ int exhaustive_do(config_t *cfg); -#endif // ECGEN_GENERATORS_H +#endif // ECGEN_EXHAUSTIVE_H diff --git a/src/io/input.h b/src/io/input.h index eb836e2..bdc86ec 100644 --- a/src/io/input.h +++ b/src/io/input.h @@ -12,37 +12,37 @@ #include "util/random.h" /** - * + * @brief Input a prime, upto <code>bits</code> long. * @param prompt * @param bits - * @return + * @return the prime as t_INT, or <code>-1</code> if a composite was given. */ GEN input_prime(const char *prompt, unsigned long bits); /** - * + * @brief Input an unsigned integer, upto <code>bits</code> long. * @param prompt * @param bits - * @return + * @return the int as t_INT, or <code>-1</code> if invalid input was given. */ GEN input_int(const char *prompt, unsigned long bits); /** - * + * @brief Input a short unsigned integer. (16 bits wide). * @param prompt - * @return + * @return the short as t_INT, or <code>-1</code> if invalid input was given. */ GEN input_short(const char *prompt); /** - * + * @brief Input a string. * @param prompt - * @return + * @return the string as a t_STR */ GEN input_string(const char *prompt); /** - * + * @brief The input FILE * to read all input from, can be <code>stdin</code>. */ extern FILE *in; diff --git a/src/io/output.h b/src/io/output.h index 6c241d5..8bf95e4 100644 --- a/src/io/output.h +++ b/src/io/output.h @@ -23,7 +23,7 @@ clock_gettime(CLOCK_MONOTONIC, &ts); \ fprintf(verbose, "%" PRIdMAX ".%.9ld ", ts.tv_sec, ts.tv_nsec); -#define debug(...) pari_fprintf(verbose, __VA_ARGS__) +#define debug(...) fprintf(verbose, __VA_ARGS__) #define debug_log(...) \ do { \ _debug_print(" - "); \ @@ -58,7 +58,7 @@ #define output_log(...) fprintf(out, __VA_ARGS__) /** - * @brief Output curve to a pari_malloc'ed string in CSV format. + * @brief Output curve to a malloc'ed string in CSV format. * @param curve * @param config * @return @@ -66,7 +66,7 @@ char *output_scsv(curve_t *curve, const config_t *cfg); /** - * @brief Output CSV separator(newline) to a pari_malloc'ed string in CSV + * @brief Output CSV separator(newline) to a malloc'ed string in CSV * format. * @param cfg * @return @@ -74,21 +74,21 @@ char *output_scsv(curve_t *curve, const config_t *cfg); char *output_scsv_separator(const config_t *cfg); /** - * @brief Output CSV output header to a pari_malloc'ed string in CSV format. + * @brief Output CSV output header to a malloc'ed string in CSV format. * @param cfg * @return */ char *output_scsv_begin(const config_t *cfg); /** - * @brief Output CSV output footer to a pari_malloc'ed string in CSV format. + * @brief Output CSV output footer to a malloc'ed string in CSV format. * @param cfg * @return */ char *output_scsv_end(const config_t *cfg); /** - * @brief Output curve to a pari_malloc'ed string in JSON format. + * @brief Output curve to a malloc'ed string in JSON format. * @param curve * @param config * @return @@ -96,7 +96,7 @@ char *output_scsv_end(const config_t *cfg); char *output_sjson(curve_t *curve, const config_t *cfg); /** - * @brief Output JSON separator(a ",\n") to a pari_malloc'ed string in CSV + * @brief Output JSON separator(a ",\n") to a malloc'ed string in CSV * format. * @param cfg * @return @@ -104,7 +104,7 @@ char *output_sjson(curve_t *curve, const config_t *cfg); char *output_sjson_separator(const config_t *cfg); /** - * @brief Output JSON output header(a "[") to a pari_malloc'ed string in CSV + * @brief Output JSON output header(a "[") to a malloc'ed string in CSV * format. * @param cfg * @return @@ -112,7 +112,7 @@ char *output_sjson_separator(const config_t *cfg); char *output_sjson_begin(const config_t *cfg); /** - * @brief Output JSON output footer(a "]") to a pari_malloc'ed string in CSV + * @brief Output JSON output footer(a "]") to a malloc'ed string in CSV * format. * @param cfg * @return @@ -120,7 +120,7 @@ char *output_sjson_begin(const config_t *cfg); char *output_sjson_end(const config_t *cfg); /** - * @brief Output curve to a pari_malloc'ed string in configured format. + * @brief Output curve to a malloc'ed string in configured format. * @param curve * @param config * @return @@ -143,7 +143,7 @@ void output_f(FILE *out, curve_t *curve, const config_t *cfg); void output_o(curve_t *curve, const config_t *cfg); /** - * @brief Output separator to a pari_malloc'ed string in configured format. + * @brief Output separator to a malloc'ed string in configured format. * @param cfg * @return */ @@ -163,7 +163,7 @@ void output_f_separator(FILE *out, const config_t *cfg); void output_o_separator(const config_t *cfg); /** - * @brief Output header to a pari_malloc'ed string in configured format. + * @brief Output header to a malloc'ed string in configured format. * @param cfg * @return */ @@ -183,7 +183,7 @@ void output_f_begin(FILE *out, const config_t *cfg); void output_o_begin(const config_t *cfg); /** - * @brief Output footer to a pari_malloc'ed string in configured format. + * @brief Output footer to a malloc'ed string in configured format. * @param cfg * @return */ @@ -208,7 +208,7 @@ void output_o_end(const config_t *cfg); extern FILE *out; /** - * @brief + * @brief Configured error output FILE*. */ extern FILE *err; diff --git a/src/misc/config.h b/src/misc/config.h index fe792d5..84ee025 100644 --- a/src/misc/config.h +++ b/src/misc/config.h @@ -33,44 +33,71 @@ typedef enum { SEED_FIPS } seed_e; +/** + * @brief + */ typedef struct { + /** @brief What field should the curves be generated over. */ enum field_e field; bool binary_field; bool prime_field; + /** @brief How many curves should be generater. */ long count; + /** @brief Whether the curves should be generated at random (no input). */ bool random; + /** @brief Whether the curves should have prime order. */ bool prime; + /** @brief Whether the curves should be generated as invalid, for some curve. */ bool invalid; + /** @brief Whether the Complex Multiplication method should be used. */ bool cm; char *order; + /** @brief Whether the curves should be trace one (Anomalous). */ bool anomalous; + /** @brief Whether the curves should be Koblitz (a \\in {0, 1}, b = 1). */ bool koblitz; long koblitz_value; + /** @brief Whether the curves should have a bound on the cofactor value. */ bool cofactor; long cofactor_bound; + /** @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. */ char *seed; + /** @brief Whether the curves should be uniquely generated (one generator). */ bool unique; + /** @brief What points to generate on the curves. */ struct points_s points; + /** @brief The datadir to use, if any. */ char *datadir; + /** @brief How much memory to allocate for the PARI stack. */ unsigned long memory; + /** @brief How many threads to use, only useful for invalid generation(atm). */ unsigned long threads; + /** @brief How much memory to allocate for the PARI stack, per thread. */ unsigned long thread_memory; + /** @brief How long of a timeout interval, if any, to give to parameter generation. */ unsigned long timeout; + /** @brief What output format to use. */ enum format_e format; + /** @brief What, if any, output file to write to. */ char *output; + /** @brief What, if any, input file to read from. */ char *input; + /** @brief Whether to append or truncate the output file on output. */ bool append; + /** @brief What verbosity level to run on. */ long verbose; + /** @brief What file, if any, to write the verbose messages. */ char *verbose_log; + /** @brief The size of the field to generate curves over, in bits. */ unsigned long bits; unsigned long hex_digits; - } config_t; #endif // ECGEN_CONFIG_H |
