commit f0456e9780776f979ac3543bc23dc31e674cf2b2
parent 60bec34711643da8d6b741a3e2a44cd95db76618
Author: Shivakumar <[email protected]>
Date: Wed, 25 Jun 2025 23:52:11 +0530
add test for curve with secp256k1
test is for generator point, scalar multiplication for the curve
secp256k1
Diffstat:
1 file changed, 23 insertions(+), 0 deletions(-)
diff --git a/tests/test_secp256k1.py b/tests/test_secp256k1.py
@@ -0,0 +1,23 @@
+from ecc import Point
+from ecc import secp256k1
+
+
+def test_generator_point():
+ Gx, Gy = secp256k1.G
+ G = Point(Gx, Gy, secp256k1)
+ assert G
+
+
+def test_scalar_multiplication():
+ Gx, Gy = secp256k1.G
+ G = Point(Gx, Gy, secp256k1)
+
+ k = 2
+ P = k * G
+
+ k_inv = pow(k, -1, secp256k1.n)
+ G_check = k_inv * P
+
+ assert G_check == G
+
+