HomeFreeBSD

crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.

Description

crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.

This is useful for WireGuard which uses a nonce of 8 bytes rather
than the 12 bytes used for IPsec and TLS.

Note that this also fixes a (should be) harmless bug in ossl(4) where
the counter was incorrectly treated as a 64-bit counter instead of a
32-bit counter in terms of wrapping when using a 12 byte nonce.
However, this required a single message (TLS record) longer than 64 *
(2^32 - 1) bytes (about 256 GB) to trigger.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32122

(cherry picked from commit 42dcd39528c6188a259951e28bbad309234324e4)

Details

Provenance
jhbAuthored on Oct 6 2021, 9:08 PM
Differential Revision
D32122: crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.
Parents
rGdffa7f13db78: crypto: Test all of the AES-CCM KAT vectors.
Branches
Unknown
Tags
Unknown