aboutsummaryrefslogtreecommitdiff
path: root/src/io/output.c
diff options
context:
space:
mode:
authorJ08nY2024-12-01 20:03:57 +0100
committerJ08nY2024-12-01 20:03:57 +0100
commit0e9aa69f03a2c6519c8eaeab571b5155d80b05c0 (patch)
tree67e79e399279ff23a5d0312e9de976564b81ff0f /src/io/output.c
parent23c460dff96f57a4fa480ab6426700b0be384f12 (diff)
downloadecgen-0e9aa69f03a2c6519c8eaeab571b5155d80b05c0.tar.gz
ecgen-0e9aa69f03a2c6519c8eaeab571b5155d80b05c0.tar.zst
ecgen-0e9aa69f03a2c6519c8eaeab571b5155d80b05c0.zip
Diffstat (limited to 'src/io/output.c')
-rw-r--r--src/io/output.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/io/output.c b/src/io/output.c
index 32b2de4..c4704c1 100644
--- a/src/io/output.c
+++ b/src/io/output.c
@@ -84,9 +84,17 @@ static JSON_Value *output_jjson(curve_t *curve) {
if (curve->seed && curve->seed->seed) {
char *hex_str = bits_to_hex(curve->seed->seed);
char *hex = try_calloc(strlen(hex_str) + 3);
- hex[0] = '0';
- hex[1] = 'x';
+ if (curve->seed->seed->sign) {
+ hex[0] = '-';
+ hex[1] = '0';
+ } else {
+ hex[0] = '0';
+ hex[1] = 'x';
+ }
strcat(hex, hex_str);
+ if (curve->seed->seed->sign) {
+ hex[2] = 'x';
+ }
json_object_set_string(root_object, "seed", hex);
try_free(hex_str);
try_free(hex);