Re: [PATCH v4 1/4] crypto: ti - Add support for AES-XTS in DTHEv2 driver

From: T Pratham

Date: Fri Oct 17 2025 - 13:05:18 EST


On 17-10-2025 11:11, Herbert Xu wrote:
> On Thu, Oct 09, 2025 at 04:11:31PM +0530, T Pratham wrote:
>>
>> +static int dthe_cipher_xts_init_tfm(struct crypto_skcipher *tfm)
>> +{
>> + struct dthe_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
>> + struct dthe_data *dev_data = dthe_get_dev(ctx);
>> +
>> + ctx->dev_data = dev_data;
>> + ctx->keylen = 0;
>> +
>> + const char *alg_name = crypto_tfm_alg_name(crypto_skcipher_tfm(tfm));
>
> Just use the name "xts(aes)" directly.

Ah, right. This can be simplified.>
>> + ctx->skcipher_fb = crypto_alloc_skcipher(alg_name, 0,
>> + CRYPTO_ALG_NEED_FALLBACK);
>
> You should allocate a fallback that is synchronous only. Then you
> can store the sub-request on the stack with SYNC_SKCIPHER_REQUEST_ON_STACK.
> Otherwise the sub-request reqsize may overflow your request object.

Understood. Will correct this.>
> Cheers,

---
Regards
T Pratham <t-pratham@xxxxxx>