Basic arithmetic operations for points on elliptic curves.
Project description
PyECCArithmetic
This package provides basic arithmethic point operations on elliptic curves. The following operations for points are available:
 Addition
 Subtraction
 Multiplication
 Division
 Order of point (for fair points)
 Inversion of a point
 Is the point on the curve?
The following curves are already implemented:
 secp224r1
 secp256r1
 secp384r1
 secp521r1
 brainpoolP160r1
 brainpoolP192r1
 brainpoolP224r1
 brainpoolP256r1
 brainpoolP320r1
 brainpoolP384r1
 brainpoolP512r1
It is also possible to define your own curve.
Installation
pip install PyECCArithmetic
Addition
from PyECCArithmetic import * p = Point(x_1, y_1, curve=Curve.secp256r1()) q = Point(x_2, y_2, curve=Curve.secp256r1()) z = p + q # z is a new point
Subtraction
from PyECCArithmetic import * p = Point(x_1, y_1) # curve defaults to Curve.secp256r1() q = Point(x_2, y_2) z = p  q # z = p + (q), z is a new point
Multiplication
Multiplication is realised with the double and add algorithm.
from PyECCArithmetic import * p = Point(x_1, y_1) # curve defaults to Curve.secp256r1() z = p * 3 # z is a new point
Division
from PyECCArithmetic import * p = Point(x_1, y_1) # curve defaults to Curve.secp256r1() q = Point(x_2, y_2) z = p / q # z is int, such that z * q == p
Order calculation
from PyECCArithmetic import * p = Point(x_1, y_1) # curve defaults to Curve.secp256r1() order = p.calcOrder(timeout=5) # tries to calculate the order for maximal timeout seconds
Custom curve definition
from PyECCArithmetic import * # Only curves defined as Weierstrass equation are supported # y^2 = x^3 + a * x + b mod p c = Curve(a, b, p, name='optional')
Is the point on the curve?
from PyECCArithmetic import * onCurve = Point(1,1).isOnCurve # true or false
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size  File type  Python version  Upload date  Hashes 

Filename, size PyECCArithmetic1.1.0py3noneany.whl (7.5 kB)  File type Wheel  Python version py3  Upload date  Hashes View 
Filename, size PyECCArithmetic1.1.0.tar.gz (5.9 kB)  File type Source  Python version None  Upload date  Hashes View 
Close
Hashes for PyECCArithmetic1.1.0py3noneany.whl
Algorithm  Hash digest  

SHA256  80f1eb188e8a1b3ce1299e7ac8c2cc1d4b6d9c4b6d34bb2d7c8b6763e16c9c11 

MD5  61b2a3b3b8c0eb7076b7157ef6fa2e5b 

BLAKE2256  7f6c146d53b0926d2e856bb9a3572f3b5f091d063787edc2231ac50cf743b4d4 