private static void add(PartialXYZT partialXYZT, XYZT extended, CachedXYT cached) {
    long[] t = new long[Field25519.LIMB_CNT];

    // Y1 + X1
    Field25519.sum(partialXYZT.xyz.x, extended.xyz.y, extended.xyz.x);

    // Y1 - X1
    Field25519.sub(partialXYZT.xyz.y, extended.xyz.y, extended.xyz.x);

    // A = (Y1 - X1) * (Y2 - X2)
    Field25519.mult(partialXYZT.xyz.y, partialXYZT.xyz.y, cached.yMinusX);

    // B = (Y1 + X1) * (Y2 + X2)
    Field25519.mult(partialXYZT.xyz.z, partialXYZT.xyz.x, cached.yPlusX);

    // C = T1 * 2d * T2 = 2d * T1 * T2 (2d is written as k in the paper)
    Field25519.mult(partialXYZT.t, extended.t, cached.t2d);

    // Z1 * Z2
    cached.multByZ(partialXYZT.xyz.x, extended.xyz.z);

    // D = 2 * Z1 * Z2
    Field25519.sum(t, partialXYZT.xyz.x, partialXYZT.xyz.x);

    // X3 = B - A
    Field25519.sub(partialXYZT.xyz.x, partialXYZT.xyz.z, partialXYZT.xyz.y);

    // Y3 = B + A
    Field25519.sum(partialXYZT.xyz.y, partialXYZT.xyz.z, partialXYZT.xyz.y);

    // Z3 = D + C
    Field25519.sum(partialXYZT.xyz.z, t, partialXYZT.t);

    // T3 = D - C
    Field25519.sub(partialXYZT.t, t, partialXYZT.t);
  }
Addition defined in Section 3.1 of
Hisil H., Wong K.KH., Carter G., Dawson E. (2008) Twisted Edwards Curves Revisited.

Please note that this is a partial of the operation listed there leaving out the final
conversion from PartialXYZT to XYZT.

@param extended extended projective point input
@param cached cached projective point input
java_src/src/main/java/com/google/crypto/tink/internal/Ed25519.java