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
Unknown Object (File)
Wed, Nov 20, 9:01 AM
Unknown Object (File)
Fri, Nov 15, 2:26 PM
Unknown Object (File)
Fri, Nov 15, 4:05 AM
Unknown Object (File)
Fri, Nov 15, 3:32 AM
Unknown Object (File)
Thu, Nov 14, 11:43 AM
Unknown Object (File)
Thu, Nov 7, 7:08 AM
Unknown Object (File)
Wed, Oct 30, 12:30 AM
Unknown Object (File)
Oct 22 2024, 7:42 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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