Is there a direct non-iterative formula for point multiplication by 3 in the secp256k1 elliptic curve just like point multiplication by 2 (point doubling)? If such a formula exists, could you explain how to achieve this? If not, could you clarify why it's not possible?
Asked
Active
Viewed 79 times
0
1 Answers
3
A simple way to derive a point tripling method in Cartesian coordinates for secp256k1 is per $3P=(2P)+P$, and towards this
- computing $2P$ by point doubling in projective coordinates with Z=1 on input, and a=0
- computing $(2P)+P$ by point addition in projective coordinates with Z=1 on one input
- finally return to Cartesian coordinates with a single modular inversion.
p = 2**256-2**32-977
def triple(x:int, y:int):
if x==0 or y==0:
return 0,0 # point at infinity
X = x2
w = 3X
R = 2y2 % p
Z = 4yR % p
u = RR
B = ((x+R)2-X-u) % p
h = (w2-2B) % p
X = 2hy % p
Y = (w(B-h)-2u) % p
u = yZ-Y % p
v = xZ-X % p
w = v2
R = wX % p
w = vw % p
A = (u2Z-w-2R) % p
h = pow(wZ,-1,p)
return vAh % p, (u(R-A)-wY)h % p
I don't claim that's optimal.
fgrieu
- 140,762
- 12
- 307
- 587
s = (Qy + Gy) * pow(Gx - Qx, -1, p) % p Rx = (s**2 - Qx - Gx) % p Ry = (s * (Rx - Qx) - Qy) % p– Favour Mar 19 '24 at 14:59