我有椭圆曲线的所有参数,以及点 Q 和 P 的坐标。我想通过测试所有可能的 k 来解决 Q = k * P (其中 k 是未知数)。
因此,我使用了这个class。
然后:
因此,我使用了这个class。
然后:
a=-1
b=0
p=134747661567386867366256408824228742802669457
curve = EllipticCurve(a,b,p)
P=[18185174461194872234733581786593019886770620,74952280828346465277451545812645059041440154]
Q=[76468233972358960368422190121977870066985660, 33884872380845276447083435959215308764231090]
for i in range(2902021510595963727029):
result = curve.multPoint(i,P)
if result[0]==Q[0] and result[1]==Q[1]:
print (i)
break
这是解决这个问题的正确方法吗?