Re: [PATCH 05/33] lib/crypto: aes: Add XTS support
From: Eric Biggers
Date: Mon Jul 13 2026 - 20:23:33 EST
On Mon, Jul 13, 2026 at 02:15:05PM +0200, Thomas Huth wrote:
> So in aes_xts_decrypt_cts, you're using a union to get a u8* pointer to the
> tweak, but in aes_xts_crypt_nocts_blockbyblock() you're casting it instead?
> ... looks a little bit inconsisten, I'd maybe use the same way in both
> functions (IMHO casting in aes_xts_decrypt_cts should be fine, too, since
> you never seem to access the individual bytes of the tweak).
In aes_xts_decrypt_cts() the buffer is first used to hold a le128 tweak,
and then it's used to hold a temporary array of length partial_len. So
it's two different purposes, and the union makes more sense there.
- Eric