private static void toByteArray(byte[] output, long num, int idx) {
    for (int i = 0; i < 4; i++, num >>= 8) {
      output[idx + i] = (byte) (num & 0xff);
    }
  }
Poly1305 one-time MAC based on RFC 7539.

<p>This is not an implementation of the MAC interface on purpose and it is not equivalent to
HMAC.

<p>The implementation is based on poly1305 implementation by Andrew Moon
(https://github.com/floodyberry/poly1305-donna) and released as public domain.
java_src/src/main/java/com/google/crypto/tink/aead/internal/Poly1305.java