lkml.org 
[lkml]   [2026]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v10 2/3] crypto: ti - Add support for AES-GCM in DTHEv2 driver
From
On 07-03-2026 10:53, Herbert Xu wrote:
> On Thu, Feb 26, 2026 at 06:24:40PM +0530, T Pratham wrote:
>>
>> + src = dthe_aead_prep_src(req->src, req->assoclen, cryptlen,
>> + src_assoc_padbuf, src_crypt_padbuf);
>> + if (IS_ERR(src)) {
>> + ret = PTR_ERR(src);
>> + goto aead_prep_src_err;
>> + }
>> +
>> + if (req->assoclen % AES_BLOCK_SIZE)
>> + assoclen += AES_BLOCK_SIZE - (req->assoclen % AES_BLOCK_SIZE);
>> + if (cryptlen % AES_BLOCK_SIZE)
>> + cryptlen += AES_BLOCK_SIZE - (cryptlen % AES_BLOCK_SIZE);
>> +
>> + src_nents = sg_nents_for_len(src, assoclen + cryptlen);
>> +
>> + if (cryptlen != 0) {
>> + dst = dthe_aead_prep_dst(req->dst, req->assoclen, unpadded_cryptlen,
>> + dst_crypt_padbuf);
>> + if (IS_ERR(dst)) {
>> + ret = PTR_ERR(dst);
>> + goto aead_prep_dst_err;
>> + }
>> +
>> + dst_nents = sg_nents_for_len(dst, cryptlen);
>> + }
>> + /* Prep finished */
>
> How does this handle the case where req->src == req->dst?

What potential issue do you see? Both `dthe_aead_prep_src` and
`dthe_prep_aead_dst` functions use `sg_split`, which anyway allocates a
new scatterlist. Even if req->src == req->dst, the src and dst from here
on will be different.

--
Regards
T Pratham <t-pratham@ti.com>

\
 
 \ /
  Last update: 2026-03-10 18:06    [W:0.077 / U:10.318 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog