Post
Topic
Board Development & Technical Discussion
Merits 2 from 1 user
Re: zero point of secp256k1
by
_Counselor
on 20/12/2021, 17:19:09 UTC
⭐ Merited by pooya87 (2)
Yes, indeed I calculate (-k*G + k*G) as any other EC addition using this function :

Code:
    LamAdd = ((b[1] - a[1]) * modinv(b[0] - a[0], P)) % P
As I said before, there is no exists inverse of zero (a[0] = b[0], b[0]-a[0] = 0)

If you modinv() function returning something with a zero argument, this is mean that is a wrong (or simplified - without error checking) implementation of modular multiplicative inverse. And that is why you're getting unexpected strange numbers in result.

Basically, zero-point, or identity point cannot be calculated, it is defined as [0;1;0] in projective coordinates or [P,0] in affine. Due to all of this, addition algorithms should contain  something like "if (p1.y == p2.y and p1.x != p2.x) return zero"