我有椭圆曲线的所有参数。以及点Q和P的坐标。我想通过测试所有可能的k来解决Q=k*P(其中k是未知数)。
所以我用了这个类
然后:
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
这是解决这个问题的正确方法吗?