Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.35 KB

README.md

File metadata and controls

68 lines (47 loc) · 2.35 KB

ECDSA in Go

This repository contains a set of tools to compute operations on an elliptic curve.

Elliptic Curve

An elliptic curve is defined by the equation:

Elliptic Curve Equation

It looks something like this:
secp256k1 curve
secp256k1 curve used by Bitcoin
a
b

Point operations

See ECDSA point operations.

Point at infinity

Point at infinity is defined by
O

  • O + O = O
  • P + O = P

Point negation

  • P - P = O
  • P - Q = 0

Point addition

P + Q = R
Where R is the negation of the intersection of the straight line defined by P and Q, and the curve.

Illustration

lambda

R

Point doubling

P + P = R
Where R is the negation of the intersection of the curve's tangent at P, and the curve.

lambda

R

Point multiplication

Point multiplication is the repetition of point addition.
Equation

Montgomery ladder algorithm

R00
  R1P
  for i from m downto 0 do
     if di = 0 then
        R1point_add(R0, R1)
        R0point_double(R0)
     else
        R0point_add(R0, R1)
        R1point_double(R1)
  return R0