-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecdsaModule.py
More file actions
22 lines (15 loc) · 760 Bytes
/
ecdsaModule.py
File metadata and controls
22 lines (15 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from tinyec.ec import SubGroup, Curve
name = 'secp256k1'
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
a = 0x0000000000000000000000000000000000000000000000000000000000000000
b = 0x0000000000000000000000000000000000000000000000000000000000000007
g = (0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798, 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8)
h = 1
curve = Curve(a, b, SubGroup(p, g, n, h), name)
pubKey = curve.g* 0x000000000000000000000000000000000000147ae147ae147ae147ae147ae148
print("pk", pubKey)
print(f"pk({pubKey.x:0x}, {pubKey.y:0x})")
for i in range(10):
pubKey = curve.g * i
print("pk", pubKey)