diff options
| author | J08nY | 2017-09-19 12:40:37 +0200 |
|---|---|---|
| committer | J08nY | 2017-09-19 12:40:37 +0200 |
| commit | 3fad579c3cbcbce457f36af6c1ceff37ec04ee54 (patch) | |
| tree | ee86b1e858754afaadd5f7e55b87021485e78b64 /src/io/output.c | |
| parent | 0a3aea134eea8aaa819548c4ad8c7c653830f5b4 (diff) | |
| download | ecgen-3fad579c3cbcbce457f36af6c1ceff37ec04ee54.tar.gz ecgen-3fad579c3cbcbce457f36af6c1ceff37ec04ee54.tar.zst ecgen-3fad579c3cbcbce457f36af6c1ceff37ec04ee54.zip | |
Diffstat (limited to 'src/io/output.c')
| -rw-r--r-- | src/io/output.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/io/output.c b/src/io/output.c index 4cabafd..4e951a2 100644 --- a/src/io/output.c +++ b/src/io/output.c @@ -5,6 +5,7 @@ #include "output.h" #include <parson/parson.h> +#include "util/bits.h" #include "gen/field.h" #include "util/memory.h" @@ -154,6 +155,16 @@ static JSON_Value *output_jjson(curve_t *curve, const config_t *cfg) { fprintf(err, "Error, field has unknown amount of elements.\n"); exit(1); } + if (curve->seed) { + char *hex_str = bits_to_hex(curve->seed->seed); + char *hex = try_calloc(strlen(hex_str) + 3); + hex[0] = '0'; + hex[1] = 'x'; + strcat(hex, hex_str); + json_object_set_string(root_object, "seed", hex); + try_free(hex_str); + try_free(hex); + } char *a = pari_sprintf("%P0#*x", cfg->hex_digits, field_elementi(curve->a)); json_object_set_string(root_object, "a", a); |
