I have some test vectors included in the source code for my secp256k1
implementation called ekliptic
. This sounds like it might be similar to what you're after. However... you should probably convert Jacobian coordinates back to affine coordinates before comparing the results of Jacobian point addition/doubling operations. Here's why.
For any affine point $(x_a,y_a)$, there is an absurdly large number of possible Jacobian coordinate triplets $(x_j,y_j,z)$ which satisfy the requirements of Jacobian coordinates:
$$x_a = \frac{x_j}{z^2}$$
$$y_a = \frac{y_j}{z^3}$$
$z$ is basically a scaling factor we use to defer and accumulate division operations.
As a more concrete example, one could represent the affine point $(7,10)$ as the Jacobian $(x,y,z)$ points:
- $(7,10,1)$
- $(28,80,2)$
- $(63,270,3)$
- $(112,640,4)$
- etc etc.
As a result, I've found that different addition/doubling formulas will give me different Jacobian coordinates. For example, in my ekliptic
library, I used the add-1998-cmo-2
formula for addition. But if I used a different addition formula to add the same two Jacobian points, I might get a different $(x_j,y_j,z)$ output. Indeed when i tried to scrape and reuse some test vectors from the btcec
project, i ran into exactly this issue, because they chose different formulas than I chose.
As long as two sets of Jacobian coordinates simplify to the same affine point $(x_a,y_a)$, they are still fundamentally equivalent, but this means that test vectors from one project may not be reusable for yours, without doing some conversions first.
Usually converting back to affine is simpler.