Skip to content

Point Addition and point doubling on Elliptic Curve in the set of real numbers. Only Weierstrass EC supported for now.

Notifications You must be signed in to change notification settings

DanielArian/elliptic-curves-in-real-set

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elliptic-curves-in-real-set

A ECMAScript module to perform point Addition and point doubling on Elliptic Curve in the set of real numbers. Only Weierstrass EC supported for now.

Supported curves for now :

Weierstrass

Math behind point addition for Weierstrass EC

See : https://crypto.stanford.edu/pbc/notes/elliptic/explicit.html

Example

import { Weierstrass, WeierstrassPoint } from 'ecurves-in-real-set'

// Y^2 + a1 XY + a3 * Y = X^3 + a2 X^2 + a4 X + a6

// Initiate a new weierstrass cruve instance
// Let's use Short weierstrass equation : y2 = x3 + ax + b

let a = 2;
let b = 1;

let curve = new Weierstrass(0, 0, 0, a, b);
console.log("Curve equation:", curve.toString())

// create two points
let P = new WeierstrassPoint(curve, 0, 1);
let Q = new WeierstrassPoint(curve, 1.98, 3.567);

// add points or double a point
console.log("P + Q = ", P.add(Q).toString())
console.log("2P =", P.double().toString());

About

Point Addition and point doubling on Elliptic Curve in the set of real numbers. Only Weierstrass EC supported for now.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published