aboutsummaryrefslogtreecommitdiff
path: root/generate_parameters.py
diff options
context:
space:
mode:
authorGravatar jadep <jade.philipoom@gmail.com>2017-10-13 14:37:32 -0400
committerGravatar jadep <jade.philipoom@gmail.com>2017-10-13 15:50:32 -0400
commit2329cfc161694defbb54ad5d461baa7d154498bb (patch)
treeb64c3605ee87e2fe586109382091530a1397b4ef /generate_parameters.py
parent4a841325e81d808f3924f4700eb3728a3b48b2bf (diff)
add examples to json-generation file for reference
Diffstat (limited to 'generate_parameters.py')
-rw-r--r--generate_parameters.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/generate_parameters.py b/generate_parameters.py
index d7dcf75e8..bf45281ec 100644
--- a/generate_parameters.py
+++ b/generate_parameters.py
@@ -1,3 +1,70 @@
+
+'''
+EXAMPLES (handwritten):
+
+
+# p256 - amd128
+{
+ "modulus" : "2^256-2^224+2^192+2^96-1",
+ "base" : "128",
+ "sz" : "2",
+ "bitwidth" : "128",
+ "montgomery" : "true",
+ "operations" : ["fenz", "feadd", "femul", "feopp", "fesub"],
+ "compiler" : "gcc -fno-peephole2 `#GCC BUG 81300` -march=native -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes -Wno-incompatible-pointer-types -fno-strict-aliasing"
+}
+
+# p256 - amd64
+{
+ "modulus" : "2^256-2^224+2^192+2^96-1",
+ "base" : "64",
+ "sz" : "4",
+ "bitwidth" : "64",
+ "montgomery" : "true",
+ "operations" : ["fenz", "feadd", "femul", "feopp", "fesub"],
+ "compiler" : "gcc -fno-peephole2 `#GCC BUG 81300` -march=native -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes -Wno-incompatible-pointer-types -fno-strict-aliasing"
+}
+
+
+# p448 - c64
+{
+ "modulus" : "2^448-2^224-1",
+ "base" : "56",
+ "goldilocks" : "true",
+ "sz" : "8",
+ "bitwidth" : "64",
+ "carry_chains" : [[3, 7],
+ [0, 4, 1, 5, 2, 6, 3, 7],
+ [4, 0]],
+ "coef_div_modulus" : "2",
+ "operations" : ["femul"]
+}
+
+# curve25519 - c64
+{
+ "modulus" : "2^255-19",
+ "base" : "51",
+ "sz" : "5",
+ "bitwidth" : "64",
+ "carry_chains" : "default",
+ "coef_div_modulus" : "2",
+ "operations" : ["femul", "fesquare", "freeze"],
+ "compiler" : "gcc -march=native -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes",
+}
+
+# curve25519 - c32
+{
+ "modulus" : "2^255-19",
+ "base" : "25.5",
+ "sz" : "10",
+ "bitwidth" : "32",
+ "carry_chains" : "default",
+ "coef_div_modulus" : "2",
+ "operations" : ["femul", "fesquare", "freeze"],
+ "compiler" : "gcc -march=native -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes",
+}
+
+'''
COMPILER = "gcc -fno-peephole2 `#GCC BUG 81300` -march=native -mtune=native -std=gnu11 -O3 -flto -fomit-frame-pointer -fwrapv -Wno-attributes -Wno-incompatible-pointer-types -fno-strict-aliasing"
# given a string representing one term or "tap" in a prime, returns a pair of