aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/90-crypto/rechnungen
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@ost.ch>2021-02-02 21:31:33 +0100
committerAndreas Müller <andreas.mueller@ost.ch>2021-02-02 21:31:33 +0100
commit5125e2d9711ffd6904384159829673155cab683d (patch)
tree1cfe30bf0736adb7f59a50ec7a804e09b2ce9bf8 /buch/chapters/90-crypto/rechnungen
parentintro to elliptic curve crypto (diff)
downloadSeminarMatrizen-5125e2d9711ffd6904384159829673155cab683d.tar.gz
SeminarMatrizen-5125e2d9711ffd6904384159829673155cab683d.zip
new stuff
Diffstat (limited to 'buch/chapters/90-crypto/rechnungen')
-rw-r--r--buch/chapters/90-crypto/rechnungen/elliptic.maxima42
-rw-r--r--buch/chapters/90-crypto/rechnungen/tangent.maxima67
2 files changed, 109 insertions, 0 deletions
diff --git a/buch/chapters/90-crypto/rechnungen/elliptic.maxima b/buch/chapters/90-crypto/rechnungen/elliptic.maxima
new file mode 100644
index 0000000..8c43e6c
--- /dev/null
+++ b/buch/chapters/90-crypto/rechnungen/elliptic.maxima
@@ -0,0 +1,42 @@
+/*
+ * elliptic.maxima
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+ */
+
+p: Y^2+X*Y - X^3 - a*X -b;
+
+x: x1*t+(1-t)*x2;
+y: y1*t+(1-t)*y2;
+
+q: subst(x,X,p);
+q: subst(y,Y,q);
+q: ratsimp(expand(q));
+tex(q);
+
+qr: divide(q,t*(t-1),t);
+r: qr[2];
+q: qr[1];
+tex(q);
+
+subst(0,t,r);
+subst(1,t,r);
+
+tex(r);
+
+polydecomp(qr[2], t);
+
+s: solve(q = 0, t);
+tex(s);
+
+x3: ratsimp(expand(subst(s, x)));
+y3: ratsimp(expand(subst(s, y)));
+
+tex(x3);
+tex(y3);
+
+Y3: expand(y3 * (x2-x1)^3 - (y2-y1)^3 - (x2-x1)*(y2-y1)^2 );
+Y3: factor(expand(Y3));
+tex(Y3);
+
+
diff --git a/buch/chapters/90-crypto/rechnungen/tangent.maxima b/buch/chapters/90-crypto/rechnungen/tangent.maxima
new file mode 100644
index 0000000..aa7d236
--- /dev/null
+++ b/buch/chapters/90-crypto/rechnungen/tangent.maxima
@@ -0,0 +1,67 @@
+/*
+ * tangent.maxima
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+ */
+
+p: Y^2+X*Y - X^3 - a*X -b;
+
+x: x1 + u * t;
+y: y1 + v * t;
+
+q: subst(x,X,p);
+q: subst(y,Y,q);
+q: ratsimp(expand(q));
+tex(q);
+tex(coeff(expand(q), t, 3));
+tex(coeff(expand(q), t, 2));
+tex(coeff(expand(q), t, 1));
+tex(coeff(expand(q), t, 0));
+qr: divide(q,t^2,t);
+r: qr[2];
+s: solve(qr[1] = 0, t);
+tex(s);
+
+T: subst(s, t);
+
+U: x1+2*y1;
+V: y1-3*x1^2-a;
+X: subst(U, u, x);
+Y: subst(V, v, y);
+T: subst(U, u, T);
+T: subst(V, v, T);
+ratsimp(expand(T));
+
+q: subst(U, u, q);
+q: subst(V, v, q);
+
+qr: divide(q,t^2,t);
+r: qr[2];
+q: qr[1];
+tex(q);
+
+tex(coeff(r, t, 3));
+tex(coeff(r, t, 2));
+tex(coeff(r, t, 1));
+tex(coeff(r, t, 0));
+
+subst(0,t,r);
+subst(0,t,diff(r,t));
+
+tex(r);
+
+polydecomp(qr[2], t);
+
+s: solve(q = 0, t);
+tex(s);
+
+/*
+x3: ratsimp(expand(subst(s, -X)));
+y3: ratsimp(expand(subst(s, -Y-X)));
+*/
+
+x3: ratsimp(expand(subst(s, X)));
+y3: ratsimp(expand(subst(s, Y)));
+
+tex(x3);
+tex(y3);