aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/ec/efd
diff options
context:
space:
mode:
authorJ08nY2020-07-01 23:08:43 +0200
committerJ08nY2020-07-01 23:09:30 +0200
commit2aa191c63c556857ee22e801c19ee9822016f7cc (patch)
tree8824b678714c71979c4f8579c9cf782a6fadcc5e /pyecsca/ec/efd
parent3eaaed8ff2dfa36ad31884bc4cb0f45e0bf8f427 (diff)
downloadpyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.gz
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.tar.zst
pyecsca-2aa191c63c556857ee22e801c19ee9822016f7cc.zip
Add random generation of points, speedup computation.
Diffstat (limited to 'pyecsca/ec/efd')
-rw-r--r--pyecsca/ec/efd/edwards/coordinates1
-rw-r--r--pyecsca/ec/efd/montgom/coordinates1
-rw-r--r--pyecsca/ec/efd/shortw/coordinates1
-rw-r--r--pyecsca/ec/efd/twisted/coordinates1
4 files changed, 4 insertions, 0 deletions
diff --git a/pyecsca/ec/efd/edwards/coordinates b/pyecsca/ec/efd/edwards/coordinates
index dc85a7a..f70f3c8 100644
--- a/pyecsca/ec/efd/edwards/coordinates
+++ b/pyecsca/ec/efd/edwards/coordinates
@@ -4,6 +4,7 @@ parameter d
coordinate x
coordinate y
satisfying x^2+y^2 == c^2*(1+d*x^2*y^2)
+ysquared (x^2-c^2)/(c^2*d*x^2-1)
addition x = (x1*y2+y1*x2)/(c(1+d*x1*x2*y1*y2))
addition y = (y1*y2-x1*x2)/(c(1-d*x1*x2*y1*y2))
doubling x = (x1*y1+y1*x1)/(c(1+d*x1*x1*y1*y1))
diff --git a/pyecsca/ec/efd/montgom/coordinates b/pyecsca/ec/efd/montgom/coordinates
index 0821ec6..d3b7f4e 100644
--- a/pyecsca/ec/efd/montgom/coordinates
+++ b/pyecsca/ec/efd/montgom/coordinates
@@ -4,6 +4,7 @@ parameter b
coordinate x
coordinate y
satisfying b*y^2 == x^3 + a*x^2 + x
+ysquared (x^3+a*x^2+x)/b
addition x = b*(y2-y1)^2/(x2-x1)^2-a-x1-x2
addition y = (2*x1+x2+a)*(y2-y1)/(x2-x1)-b*(y2-y1)^3/(x2-x1)^3-y1
doubling x = b*(3*x1^2+2*a*x1+1)^2/(2*b*y1)^2-a-x1-x1
diff --git a/pyecsca/ec/efd/shortw/coordinates b/pyecsca/ec/efd/shortw/coordinates
index 683d86d..fa93043 100644
--- a/pyecsca/ec/efd/shortw/coordinates
+++ b/pyecsca/ec/efd/shortw/coordinates
@@ -4,6 +4,7 @@ parameter b
coordinate x
coordinate y
satisfying y^2 == x^3 + a*x + b
+ysquared x^3+a*x+b
addition x = (y2-y1)^2/(x2-x1)^2-x1-x2
addition y = (2*x1+x2)*(y2-y1)/(x2-x1)-(y2-y1)^3/(x2-x1)^3-y1
doubling x = (3*x1^2+a)^2/(2*y1)^2-x1-x1
diff --git a/pyecsca/ec/efd/twisted/coordinates b/pyecsca/ec/efd/twisted/coordinates
index 1a0d32d..bf62fff 100644
--- a/pyecsca/ec/efd/twisted/coordinates
+++ b/pyecsca/ec/efd/twisted/coordinates
@@ -4,6 +4,7 @@ parameter d
coordinate x
coordinate y
satisfying a*x^2+y^2 == 1+d*x^2*y^2
+ysquared (a*x^2-1)/(d*x^2-1)
addition x = (x1*y2+y1*x2)/(1+d*x1*x2*y1*y2)
addition y = (y1*y2-a*x1*x2)/(1-d*x1*x2*y1*y2)
doubling x = (x1*y1+y1*x1)/(1+d*x1*x1*y1*y1)