New answers tagged

0

As other's have said, the essential point is the algebraic definition for additive inverses in elliptic arithemetic. -(x,y)=(x,-y) But if it helps, there are also some nice geometric illustrations like this one from Vitalik Buterin's Exploring Elliptic Curve Pairings: Suppose R = (x,y). Since the elliptic curve is symmetric with respect to the x-axis, we ...


0

Here is the sample of code for subtraction of two points. # -*- coding: utf-8 -*- def OnCurve(x,y): # Check if the point is on the curve A = (y*y)%P B = (x*x*x)%P C = False if A == (B + 7): C = True return C def ECadd(xp,yp,xq,yq): # EC point addition m = ((yq-yp) * modinv(xq-xp,P))%P xr = (m*m-xp-xq)%P yr = (m*(xp-...


4

You can negate a point (x, y) by simply changing it to (x, −y). The document that defines ECDSA reminds us of this fact: https://www.secg.org/sec1-v2.pdf Here's a screenshot: So once you have negated one of your points, just add it to the other one, and you have achieved subtraction.


Top 50 recent answers are included