Re: [PATCH v2] crypto: chacha - Consolidate XChaCha initialization
From: Eric Biggers
Date: Fri Dec 04 2026 - 01:34:43 EST
On Thu, Dec 03, 2026 at 05:43:28PM -0800, Laveesh Bansal wrote:
> XChaCha initialization is repeated in three places. Each one derives a
> subkey with HChaCha from the key and the first 16 bytes of the nonce,
> then builds the ChaCha state from that subkey and the last 8 bytes of
> the nonce.
>
> Add xchacha_init() to <crypto/chacha.h> and use it in all three. No
> functional change.
>
> Signed-off-by: Laveesh Bansal <laveeshb@xxxxxxxxxxxxxxxxx>
Reviewed-by: Eric Biggers <ebiggers@xxxxxxxxxx>
- Eric