aboutsummaryrefslogtreecommitdiff
path: root/src/io/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/output.c')
-rw-r--r--src/io/output.c11
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);