ChaCha20- and Poly1305-based Cipher Suites for TLS
tools.ietf.org
tools.ietf.org
I started out with Salsa but switched because I also slight prefer ChaCha and people seemed to agree.
just seems odd to go to the effort of specifying how to safely implement a counter in some detail in the paper when a random value seems fine (it's also quite possible i've misunderstood something - these are all new to me).
In Poly1305-AES, the point at which the polynomial is evaluated (r) is random, but the value added at the end is calculated as AES_k(nonce). Basically, AES was used to map from a counter to a secret value. It's very important that that value not be reused, because the security the system falls apart.
In my draft, I'm not using AES. Rather I use a block of ChaCha20 to generate the value to add at the end and a different r value for each message.
But there is essentially the same problem: an nonce still needs to be fed into the cipher and it must not repeat. (Additionally, repeating the nonce here breaks confidentiality too as the keystream will repeat and the attacker gets the XOR of the two plaintexts.)
TLS already has a counter for this, which is used here.
(Alternatively, some AES-GCM implementations in TLS use an 8-byte, random value as the nonce, which stands a good chance of repeating after 232 records :( )
(disclaimer: I worked for a company that sold a GCM implementation)
You can debate whether it's a "software implementation" since it's using AESNI and PCLMULQDQ.