Nimony

The road to Nim 3

chacha20poly1305

nimony/lib/std/crypto/chacha20poly1305.nim

ChaCha20, Poly1305 and their AEAD construction (RFC 8439).

Constant time by construction: ChaCha20 is additions, rotations and xors only, and Poly1305 is done in 26-bit limbs so that every product fits a uint64 and the final reduction is a mask, not a branch.