Check if two ed25519 points are equivalent How to check if two points are equivalent given their projective coordinates (XYTZ)?

For example if I do unproject() of a point to pass from XYTZ to XY coordinates and then I come back to XYTZ coordinates, the new XYTZ coordinates are different respect to the original ones.

How can I be sure that the two points are equivalent in C if they are represented in the following way:

struct ed25519_pt {
    uint8_t  x[32];
    uint8_t  y[32];
    uint8_t  t[32];
    uint8_t  z[32];
};
Short answer:

The affine coordinates are (X/Z, Y/Z).

So, check that Y1*(1/Z1) ≡ Y2*(1/Z2) and that the signs of X1*Z1 and X2*Z2 are the same.

Z being 0 represents the point at infinity.

Slightly longer answer:

Think about (X, Y, Z) as a fraction representation of (X', Y') with X' = X/Z and Y' = Y/Z. T is just X*Y and is not relevant here.

What you mean by "unproject" is going from a fraction to a scalar. Once this is done, you get something equivalent, but the denominator is lost.

You can go back to a fraction representation by setting the denominator to 1. This is what happens when you go from an affine representation to a projective or extended one.

(X, Y, Z) may look different after a round trip, but this is the same set of affine coordinates, just with a different denominator Z.