elliptic curve point doubling in Jacobian coordinates

I am writing an application that uses Elliptic curve Diffie–Hellman for authentication.

I found two formulas for point doubling in Jacobian coordinates.

1st) $$X_1 = (3x^2 + aZ^4)^2 - 8xy^2$$ 2nd) $$X_1 = (3 (x - z^2)(x + z^2))^2 - 8xy^2$$

The second formula is for curve $$y^2 = x^3 -3x +b$$

I noticed that for curve "SECP112R1", both formulas give identical results. But for a random curve (example $p = 263$, $a = 2$, $b = 3$, $x = 200$, $y = 39$) it is not the same.

Is there a way I can transform my curve such that I can get identical result from both formulas?

Is there a way I can generate a curve that can use both the formulas for point doubling?

-
the 2nd formula can be used for curves that that dont have a = -3 but have a = p - 3 and probably some other criteria. "SECP112R1", "SECP128R1", "SECP160R1", "nistp256" are such curves. – user469635 Mar 30 at 22:24

2 Answers

The 2nd formula is the first formula with $a=-3$

$3x^{2} + (-3)z^{4}$

$= 3(x^2 - z^4)$

$= 3(x-z^2)(x+z^2)$

So the result isn't going to be the same when $a$ is different.

-

If $a = -3$, then we have $3(x - z^2)(x + z^2) = 3x^2 - 3z^4 = 3x^2 + az^4$, and so the two formulii give the same result.

-