diff options
| author | J08nY | 2018-01-18 18:37:44 +0100 |
|---|---|---|
| committer | J08nY | 2018-01-18 18:40:06 +0100 |
| commit | cf074191532caef918fb9f502b37697094da317a (patch) | |
| tree | 9826a5f436aba9fcbfbba8dfd5e615267213123f /src/io/cli.c | |
| parent | f940f80a2cb69ffcd1f0d608cbb1b0f06e0854d6 (diff) | |
| download | ecgen-cf074191532caef918fb9f502b37697094da317a.tar.gz ecgen-cf074191532caef918fb9f502b37697094da317a.tar.zst ecgen-cf074191532caef918fb9f502b37697094da317a.zip | |
Diffstat (limited to 'src/io/cli.c')
| -rw-r--r-- | src/io/cli.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/io/cli.c b/src/io/cli.c index efedb8b..46ef47a 100644 --- a/src/io/cli.c +++ b/src/io/cli.c @@ -41,7 +41,8 @@ enum opt_keys { OPT_GPGEN, OPT_GPCHECK, OPT_HEXCHECK, - OPT_BRAINPOOL_RFC + OPT_BRAINPOOL_RFC, + OPT_TWIST, }; // clang-format off @@ -57,6 +58,7 @@ struct argp_option cli_options[] = { {"brainpool", OPT_BRAINPOOL, "SEED", OPTION_ARG_OPTIONAL, "Generate a curve from SEED (Brainpool procedure).", 2}, {"brainpool-rfc", OPT_BRAINPOOL_RFC, "SEED", OPTION_ARG_OPTIONAL, "Generate a curve from SEED (Brainpool procedure, as per RFC 5639).", 2}, {"invalid", OPT_INVALID, 0, 0, "Generate a set of invalid curves, for a given curve (using Invalid curve algorithm).", 2}, + {"twist", OPT_TWIST, 0, 0, "Generate a twist of a given curve.", 2}, {0, 0, 0, 0, "Generation options:", 3}, {"random", OPT_RANDOM, 0, 0, "Generate a random curve (using Random approach).", 3}, @@ -139,6 +141,7 @@ static void cli_end(struct argp_state *state) { case METHOD_ANOMALOUS: case METHOD_SEED: case METHOD_INVALID: + case METHOD_TWIST: break; default: printf("%u\n", cfg->method); @@ -257,6 +260,9 @@ error_t cli_parse(int key, char *arg, struct argp_state *state) { cfg->seed = arg; } break; + case OPT_TWIST: + cfg->method |= METHOD_TWIST; + break; /* Generation options */ case OPT_COUNT: |
