private byte[] toLittleEndian(BigInteger n) {
    byte[] b = new byte[32];
    byte[] nBytes = n.toByteArray();
    System.arraycopy(nBytes, 0, b, 32 - nBytes.length, nBytes.length);
    for (int i = 0; i < b.length / 2; i++) {
      byte t = b[i];
      b[i] = b[b.length - i - 1];
      b[b.length - i - 1] = t;
    }
    return b;
  }
The idea of basic tests is simple. We generate random numbers, make computations with
Field25519 and compare the results with Java BigInteger.
java_src/src/test/java/com/google/crypto/tink/internal/Field25519Test.java