How to Sub two EcPoint


(Manxiaqu) #1

I’m a beginner in crypto. Recently I try to do some research on the curve. But I didn’t find any code for Subtraction of two EcPoints.


for example: EcPoint a - EcPoint b.

I have tried something below:

  1. using a + (-1) * b; but the result seems incorrect.
  2. compute negation formulas of b(https://www.hyperelliptic.org/EFD/g1p/auto-shortw.html), and compute a + negation of b. through the negation of b + b is zero. but the negation of b is not on curve and the result is also incorrect.

anyone have some ideas about this, am I doing something wrong?