Sunday, November 17, 2019

TI-84 Plus CE: Simple Elliptic Curves Determined by Two Points

TI-84 Plus CE:  Simple Elliptic Curves Determined by Two Points

Introduction

The program ECURVE determines the coefficients of a simple elliptic curve:

y^2 = x^3 + G * x + H

from two points P:(A,B) and Q:(C,D).  It also computes the point R:(E,F) by the following equations:

E = θ^2 - A - C
F = θ * (A + C) - B

Determining G and H.

Using the two points P:(A,B) and Q:(C,D):

A^3 + A * G + H = B^2
C^3 + C * G + H = D^2

A * G + H = B^2 - A^3
C * G + H = D^2 - C^3

Subtracting the bottom equation from the top gets:

( A - C ) * G = (B^2 - A^3) - (D^2 - C^3)
G = ( (B^2 - A^3) - (D^2 - C^3) ) / (A - C)

H can be determined one of two ways:

H = B^2 - A^3 - A * G
H = D^2 - C^3 - C * G

TI-84 Plus CE Program:  ECURVE

Func
FnOff
"EWS 2019-10-20"
Disp "P:(A,B), Q:(C,D)"
Prompt A,B,C,D
(D-B)/(C-A)→θ
θ^2-A-C→E
θ*(A+E)-B→F
Disp "R:(E,F)",E,F
Pause
((B^2-A^3)-(D^2-C^3))/(A-C)→G
B^2-A^3-A*G→H
Disp "Y^2=X^3+G*X+H",G,H
Pause
"√(X^3+G*X+H)"→Y_1
"-Y_1"→Y_2
ZoomFit

Y_1 and Y_2 are the Y1 and Y2 from the Vars, Y-Vars, Function menu.

Example 1

P:(-2, 3)  (A = -2, B = 3)
Q:(-1, 0)  (C = -1, D = 0)

Results:
R:(12, -33)  (E = 12, F = -33)
G = -16
H = -15

Equation:  y^2 = x^3 - 16 x - 15



Example 2

P:(-1, 1)  (A = -1, B = 1)
Q:(2, 4)  (C = 2, D = 4)

Results:
R:(0, -2)  (E = 0, F = -2)
G = 2
H = 4

Equation:  y^2 = x^3 + 2 x + 4



Source:

Rosing, Michael. Implementing Elliptic Curve Cryptography Manning Publishing Co: Greenwich, CT  1999   ISBN 10:  1884777694



Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.