From: T Pratham <t-pratham@ti.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
Manorit Chawdhry <m-chawdhry@ti.com>,
Kamlesh Gurudasani <kamlesh@ti.com>,
Shiva Tripathi <s-tripathi1@ti.com>,
Kavitha Malarvizhi <k-malarvizhi@ti.com>,
"Vishal Mahaveer" <vishalm@ti.com>,
Praneeth Bajjuri <praneeth@ti.com>,
<linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v10 2/3] crypto: ti - Add support for AES-GCM in DTHEv2 driver
Date: Tue, 10 Mar 2026 22:35:15 +0530 [thread overview]
Message-ID: <26303ab7-cd14-4560-8872-021229faa137@ti.com> (raw)
In-Reply-To: <aau2bg4gdM0VPcEo@gondor.apana.org.au>
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>
next prev parent reply other threads:[~2026-03-10 17:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 12:54 [PATCH v10 0/3] Add support for more AES modes in TI DTHEv2 T Pratham
2026-02-26 12:54 ` [PATCH v10 1/3] crypto: ti - Add support for AES-CTR in DTHEv2 driver T Pratham
2026-03-07 5:35 ` Herbert Xu
2026-02-26 12:54 ` [PATCH v10 2/3] crypto: ti - Add support for AES-GCM " T Pratham
2026-03-07 5:23 ` Herbert Xu
2026-03-10 17:05 ` T Pratham [this message]
2026-03-11 4:16 ` Herbert Xu
2026-03-11 5:32 ` T Pratham
2026-02-26 12:54 ` [PATCH v10 3/3] crypto: ti - Add support for AES-CCM " T Pratham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26303ab7-cd14-4560-8872-021229faa137@ti.com \
--to=t-pratham@ti.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=k-malarvizhi@ti.com \
--cc=kamlesh@ti.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-chawdhry@ti.com \
--cc=praneeth@ti.com \
--cc=s-tripathi1@ti.com \
--cc=vishalm@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®