Our implementation of ChaCha20 is based on RFC 7539 which has been declared obsolete by RFC 8439.
For example the nonce changed from 64-bit to 96-bit:
Note also that the original ChaCha had a 64-bit nonce and 64-bit block count. We have modified this here to be more consistent with recommendations in Section 3.2 of [RFC5116]. This limits the use of a single (key,nonce) combination to 2^32 blocks, or 256 GB, but that is enough for most uses. In cases where a single key is used by multiple senders, it is important to make sure that they don’t use the same nonces. This can be assured by partitioning the nonce space so that the first 32 bits are unique per sender, while the other 64 bits come from a counter.
I have no idea if any of the changes are really material.
Given that we plan to use ChaCha20 in MuHash3072 (#19055), if we ever want to write an RFC for that, we should probably use the new version of ChaCha20.
This is also relevant for the BIP-151 followup, which appears also to based on RFC 7539. Since the original BIP151 is withdrawn and its replacement hasn’t been proposed, it’s not too late to change that. RFC 8439 also defines ChaCha20-Poly1305, at minimum the test vectors seem different.
RFC 8439 has some errata:
- bug in Poly1305 pseudo code (2.5.1)
- bug in ChaCha20 pseudo code (2.4.1)
- remarks about constant-timeness for Poly1305