aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJ08nY2018-06-30 17:25:24 +0200
committerJ08nY2018-06-30 17:41:20 +0200
commite6e0fb4ebd895db39ae9ac19c0e04a0c3201cbf5 (patch)
tree121c1b56b86a6978b9839e254a0fe5e4ea4a0431 /util
parenta1062c93da92e518b2faefdb4827a3f62646edb1 (diff)
downloadecgen-e6e0fb4ebd895db39ae9ac19c0e04a0c3201cbf5.tar.gz
ecgen-e6e0fb4ebd895db39ae9ac19c0e04a0c3201cbf5.tar.zst
ecgen-e6e0fb4ebd895db39ae9ac19c0e04a0c3201cbf5.zip
Diffstat (limited to 'util')
-rwxr-xr-xutil/csv.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/csv.sh b/util/csv.sh
new file mode 100755
index 0000000..3b357cf
--- /dev/null
+++ b/util/csv.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Transform the JSON output of ecgen into CSV.
+# For F_p curves:
+# p, a, b, G.x, G.y, G.order, G.cofactor
+# For F_2^m curves:
+# m, e1, e2, e3, a, b, G.x, G.y, G.order, G.cofactor
+#
+# Where G is the first subgroup in "subgroups".
+jq -r -M ".[0] | (if (.field | has(\"p\")) then [.field.p] else [.field.m, .field.\"e1\", .field.\"e2\", .field.\"e3\"] end + [.a, .b, .subgroups[0].x, .subgroups[0].y, .subgroups[0].order, .subgroups[0].cofactor]) | join(\",\")" \ No newline at end of file