diff options
| author | J08nY | 2017-02-10 01:24:48 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-10 01:24:48 +0100 |
| commit | de90c5cd76bcd45c82f34d1f3d60b529b7d5a86d (patch) | |
| tree | 6d5b6923cf7443e14004e779258b4c546cf769b5 /src/math/types.h | |
| parent | 79b29481b1c4d13063dd8b6ee6a1d0d70a54faab (diff) | |
| download | ecgen-de90c5cd76bcd45c82f34d1f3d60b529b7d5a86d.tar.gz ecgen-de90c5cd76bcd45c82f34d1f3d60b529b7d5a86d.tar.zst ecgen-de90c5cd76bcd45c82f34d1f3d60b529b7d5a86d.zip | |
Diffstat (limited to 'src/math/types.h')
| -rw-r--r-- | src/math/types.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/math/types.h b/src/math/types.h new file mode 100644 index 0000000..8185078 --- /dev/null +++ b/src/math/types.h @@ -0,0 +1,44 @@ +/* + * ecgen, tool for generating Elliptic curve domain parameters + * Copyright (C) 2017 J08nY + */ +#ifndef ECGEN_TYPES_H +#define ECGEN_TYPES_H + +#include <pari/pari.h> +#include "io/cli.h" + +typedef struct seed { GEN seed; } seed_t; + +typedef struct point_t { + GEN point; + GEN order; +} point_t; + +typedef struct curve { + seed_t *seed; + GEN field; + GEN a; + GEN b; + GEN curve; + GEN order; + point_t **points; + size_t npoints; +} curve_t; + +enum curve_offset { + OFFSET_SEED, + OFFSET_FIELD, + OFFSET_A, + OFFSET_B, + OFFSET_CURVE, + OFFSET_ORDER, + OFFSET_POINTS, + OFFSET_END +}; + +typedef int (*gen_t)(curve_t *, config_t *, ...); + +int gen_skip(curve_t *curve, config_t *config, ...); + +#endif // ECGEN_TYPES_H |
