Page MenuHomeFreeBSD

The ChaCha20 counter is little endian, not big endian.
ClosedPublic

Authored by jhb on Feb 17 2021, 10:32 PM.
Tags
None
Referenced Files
F157126996: D28755.diff
Mon, May 18, 3:22 PM
F157126209: D28755.diff
Mon, May 18, 3:17 PM
Unknown Object (File)
Tue, May 12, 6:34 AM
Unknown Object (File)
Fri, May 8, 8:15 PM
Unknown Object (File)
Fri, May 1, 8:59 PM
Unknown Object (File)
Mon, Apr 27, 1:11 AM
Unknown Object (File)
Apr 10 2026, 1:33 AM
Unknown Object (File)
Apr 3 2026, 11:22 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 37134
Build 34023: arc lint + arc unit

Event Timeline

Hm, it is little endian, but I'm not confident about the two sentences prior.

In D28755#644005, @cem wrote:

Hm, it is little endian, but I'm not confident about the two sentences prior.

The variant in the kernel uses the 8/8 split. There are other variants however. libsodium has a xchacha variant that wireguard also uses (and I think that there are proposals to standardize in IETF for both IPsec and TLS) that uses a 24/4 split of nonce vs counter. If we add that in the future I would probably call it CRYPTO_XCHACHA20_POLY1305 to match the libsodium name.

Certainly not a regression :-)

This revision is now accepted and ready to land.Mar 3 2021, 5:04 AM