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
Metadata
Release files for PyECCArithmetic 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyECCArithmetic-1.1.0.tar.gz | 5.9 kB | Without provenance | Details for PyECCArithmetic-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyECCArithmetic-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for PyECCArithmetic-1.1.0-py3-none-any.whl |
Total release size: 13.4 kB
Release files / PyECCArithmetic-1.1.0.tar.gz
| Download URL | PyECCArithmetic-1.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bf7c7f13be277f0f4ee7dc507730274e068529129711ee7cb8362cf1b6b6027
|
|
BLAKE2b-256 checksum How to use checksums |
2767dc9fc2b807658b3a167db1fa3163600cf2a317f620c4c0591b39dfa2dd58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Release files / PyECCArithmetic-1.1.0-py3-none-any.whl
| Download URL | PyECCArithmetic-1.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80f1eb188e8a1b3ce1299e7ac8c2cc1d4b6d9c4b6d34bb2d7c8b6763e16c9c11
|
|
BLAKE2b-256 checksum How to use checksums |
7f6c146d53b0926d2e856bb9a3572f3b5f091d063787edc2231ac50cf743b4d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Security for PyECCArithmetic 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.