**EC Cryptography Tutorials - Herong's Tutorial Examples** - v1.03, by Herong Yang

Algebraic Solution for Point Doubling

This section provides an algebraic solution for calculating the addition operation of two points at the same location on an elliptic curve.

Case 3: P and Q are the same point. This case is also called "Point Doubling", because the addition can be expressed as P + P (or 2P):

If: P = Q Then: P + Q = P + P = 2P Let m be the slope of the straight line passing through P, the line can be expressed as the following equation: y = m(x - x_{P}) + y_{P}The other intersection, -R, of the line and the curve must satisfy the line equation and the curve equation: -y_{R}= m(x_{R}- x_{P}) + y_{P}(1) (-y_{R})^{2}= (x_{R})^{3}+ a(x_{R}) + b (2) Note that -y_{R}in equation (2) can be replaced by the right hand side of equation (1): (m(x_{R}- x_{P}) + y_{P})^{2}= (x_{R})^{3}+ a(x_{R}) + b Regrouping terms will result a cubic equation for x_{R}: (x_{R})^{3}- m^{2}(x_{R})^{2}+ (a - 2m(y_{P}) + 2m^{2}(x_{P}))(x_{R}) + b - (m(x_{P})-y_{P})^{2}= 0 We know that a cubic equation has 3 roots and their sum is the negation of the coefficient of the second term based on Vieta's first formula, see Vieta's formulas at wikipedia.org: x_{P}+ x_{P}+ x_{R}= m^{2}(3) Note that x_{P}is used twice, because it is a double root. Rearrange terms of equations (1) and (3) gives us the simplest way to calculate, R: x_{R}= m^{2}- 2x_{P}(4) y_{R}= m(x_{P}- x_{R}) - y_{P}(5) The slope of the line, m, can be calculated by taking the first derivative of the elliptic curve equation, because the line must be tangent to the curve: 3(x_{P})^{2}+ a m = --------- (6) 2(y_{P})

Now we can calculate R = 2P with equations (4), (5) and (6)
with any given point, P, except that y_{P} is not 0.

If y_{P}, then R = (∞, ∞), because the other intersection
is the infinity point.

By the way, proof of Vieta's formulas can be found in "Cubic Equations" by Arkajyoti Banerjee and Ayush G Rai at https://brilliant.org/wiki/cubic-equations/

Table of Contents

Geometric Introduction to Elliptic Curves

►Algebraic Introduction to Elliptic Curves

Algebraic Description of Elliptic Curve Addition

Algebraic Solution for Symmetrical Points

Algebraic Solution for the Infinity Point

►Algebraic Solution for Point Doubling

Algebraic Solution for Distinct Points

Elliptic Curves with Singularities

Elliptic Curve Point Addition Example

Elliptic Curve Point Doubling Example

Abelian Group and Elliptic Curves

Discrete Logarithm Problem (DLP)

Generators and Cyclic Subgroups

tinyec - Python Library for ECC

ECDH (Elliptic Curve Diffie-Hellman) Key Exchange

ECDSA (Elliptic Curve Digital Signature Algorithm)