summaryrefslogtreecommitdiff
path: root/src/gp/equation.gp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gp/equation.gp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gp/equation.gp b/src/gp/equation.gp
new file mode 100644
index 0000000..c1483e4
--- /dev/null
+++ b/src/gp/equation.gp
@@ -0,0 +1,28 @@
+/*
+ * ecgen, tool for generating Elliptic curve domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+
+/**
+ * Constructs an elliptic curve in the form E:
+ * y^2 = x^3 + ax + b, over a prime field
+ * @param a
+ * @param b
+ * @param p
+ * @returns elliptic curve
+ */
+prime_weierstrass(a:int, b:int, field:gen) = {
+ return(ellinit([a,b], field));
+}
+
+/**
+ * Constructs an elliptic curve in the form E:
+ * y^2 + xy = x^3 + ax + b, over a binary field.
+ * @param a
+ * @param b
+ * @param field
+ * @returns elliptic curve
+ */
+binary_weierstrass(a:int, b:int, field:gen) = {
+ return(ellinit([1,0,0,a,b], field));
+}