]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: x86/aesni - Perform address alignment early for XTS mode
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 28 Sep 2023 07:25:08 +0000 (00:25 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 5 Oct 2023 10:16:30 +0000 (18:16 +0800)
commite12a68b3c6ac2cecb365b57c639df71e3564d68b
tree1e3aaa0e1eb2b7c5daaa34598d6e00e2590db252
parentd148736ff17de5db1fd0e9b03e9e77615162f613
crypto: x86/aesni - Perform address alignment early for XTS mode

Currently, the alignment of each field in struct aesni_xts_ctx occurs
right before every access. However, it's possible to perform this
alignment ahead of time.

Introduce a helper function that converts struct crypto_skcipher *tfm
to struct aesni_xts_ctx *ctx and returns an aligned address. Utilize
this helper function at the beginning of each XTS function and then
eliminate redundant alignment code.

Suggested-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/all/ZFWQ4sZEVu%2FLHq+Q@gmail.com/
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Cc: linux-crypto@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c