private static void squareInner(long[] out, long[] in) {
    out[0] = in[0] * in[0];
    out[1] = 2 * in[0] * in[1];
    out[2] = 2 * (in[1] * in[1] + in[0] * in[2]);
    out[3] = 2 * (in[1] * in[2] + in[0] * in[3]);
    out[4] = in[2] * in[2] + 4 * in[1] * in[3] + 2 * in[0] * in[4];
    out[5] = 2 * (in[2] * in[3] + in[1] * in[4] + in[0] * in[5]);
    out[6] = 2 * (in[3] * in[3] + in[2] * in[4] + in[0] * in[6] + 2 * in[1] * in[5]);
    out[7] = 2 * (in[3] * in[4] + in[2] * in[5] + in[1] * in[6] + in[0] * in[7]);
    out[8] =
        in[4] * in[4] + 2 * (in[2] * in[6] + in[0] * in[8] + 2 * (in[1] * in[7] + in[3] * in[5]));
    out[9] = 2 * (in[4] * in[5] + in[3] * in[6] + in[2] * in[7] + in[1] * in[8] + in[0] * in[9]);
    out[10] =
        2 * (in[5] * in[5] + in[4] * in[6] + in[2] * in[8] + 2 * (in[3] * in[7] + in[1] * in[9]));
    out[11] = 2 * (in[5] * in[6] + in[4] * in[7] + in[3] * in[8] + in[2] * in[9]);
    out[12] = in[6] * in[6] + 2 * (in[4] * in[8] + 2 * (in[5] * in[7] + in[3] * in[9]));
    out[13] = 2 * (in[6] * in[7] + in[5] * in[8] + in[4] * in[9]);
    out[14] = 2 * (in[7] * in[7] + in[6] * in[8] + 2 * in[5] * in[9]);
    out[15] = 2 * (in[7] * in[8] + in[6] * in[9]);
    out[16] = in[8] * in[8] + 4 * in[7] * in[9];
    out[17] = 2 * in[8] * in[9];
    out[18] = 2 * in[9] * in[9];
  }
Square a number: out = in**2

<p>output must be distinct from the input. The inputs are reduced coefficient form, the output
is not.

<p>out[x] <= 14 * the largest product of the input limbs.
java_src/src/main/java/com/google/crypto/tink/internal/Field25519.java