ecc

Elliptic Curve Cryptograpy library from scratch in python.
Log | Files | Refs | README | LICENSE

commit 60bec34711643da8d6b741a3e2a44cd95db76618
parent 9f03e4db852419311e53cff3583b7716d59606ca
Author: Shivakumar <[email protected]>
Date:   Wed, 25 Jun 2025 23:50:16 +0530

make curves/ folder to test the curves, add secp256k1

using python files to import the values of curves.

Diffstat:
Mecc/__init__.py | 3+++
Aecc/curves/__init__.py | 1+
Aecc/curves/secp256k1.py | 16++++++++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/ecc/__init__.py b/ecc/__init__.py @@ -1,2 +1,5 @@ from .field import FieldElement +from .point import Point +from .curve import Curve +from .curves.secp256k1 import secp256k1, G as secp256k1_G diff --git a/ecc/curves/__init__.py b/ecc/curves/__init__.py @@ -0,0 +1 @@ +from .secp256k1 import secp256k1 diff --git a/ecc/curves/secp256k1.py b/ecc/curves/secp256k1.py @@ -0,0 +1,16 @@ +from ecc import Curve + + +a = 0 +b = 7 + +prime = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F + +G = ( + 55066263022277343669578718895168534326250603453777594175500187360389116729240, + 32670510020758816978083085130507043184471273380659243275938904335757337482424 +) + +n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 + +secp256k1 = Curve(a, b, prime, G, n)