pub fn point_double<const LIMBS: usize>(
pt: &JacobianPoint<LIMBS>,
params: &CurveParams<LIMBS>,
) -> JacobianPoint<LIMBS>Expand description
Point doubling in Jacobian coordinates for any short Weierstrass curve
y^2 = x^3 + ax + b. Uses the generic “dbl-2007-bl” formula by Bernstein-Lange
(cost: 2M + 8S + 1a-mul + 10add). Works for arbitrary a, including a=0
(secp256k1) and the random a of Brainpool curves.
Reference: https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-2007-bl
Constant-time: no branches on point values. When the input is the
point at infinity (Z1 == 0), the formulas naturally produce Z3 == 0
as well (since Z3 = (Y1+Z1)^2 - YY - ZZ = Y1^2 - Y1^2 - 0 = 0), so no
explicit special-case branch is needed. The output (X3, Y3, 0) is a
non-canonical but valid Jacobian encoding of the point at infinity.