diff options
Diffstat (limited to 'src/io/output.c')
| -rw-r--r-- | src/io/output.c | 12 |
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); |
