From: T Pratham <t-pratham@ti.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
<linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Praneeth Bajjuri <praneeth@ti.com>,
Kamlesh Gurudasani <kamlesh@ti.com>,
Manorit Chawdhry <m-chawdhry@ti.com>
Subject: Re: [PATCH RFC 1/2] crypto: ti: Add support for SHA224/256/384/512 in DTHE V2 driver
Date: Fri, 4 Apr 2025 18:10:23 +0530 [thread overview]
Message-ID: <8536cdf7-f4bd-4f9a-9eaf-9e38fba67741@ti.com> (raw)
In-Reply-To: <Z--zFB8Rm007AMzP@gondor.apana.org.au>
On 04/04/25 15:53, Herbert Xu wrote:
> Yes that's a common problem with crypto hash drivers that can't
> deal with a zero-length final update. The best solution is to
> use a fallback for the final update if it turns out to be zero-length
> rather than retaining an extra block. Hashing a single block for
> finalisation is simply not worth the overhead of setting up DMA and
> what not.
>
> The other option is to use the fallback to hash the extra block in
> the export function.
>
> Cheers,
Although yes the hardware cannot process zero length input, the actual
reason for doing this is to support the linux framework's
init-update-final flow on the hardware.
Our hardware can accept data as multiple packets, each of which can be
of any length. The only restriction it has is that only the last packet
can have arbitrary length, rest have to be a multiple of BLOCK_SIZE. The
hardware needs a bit to be set to indicate that the packet to be
submitted is the last data packet.
Now, in the crypto framework, there is no way to know if a particular
update call is the last update or if another update call will happen
after that. Therefore I am unable to set that bit in any invocation of
the update function. So I am retaining one block of data which is sent
to hardware in the final function, a place where we know for sure that
there is no more input coming now.
Regards
T Pratham <t-pratham@ti.com>
next prev parent reply other threads:[~2025-04-04 12:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 10:49 [PATCH RFC 0/2] Add support for hashing algorithms in TI DTHE V2 T Pratham
2025-02-18 10:49 ` [PATCH RFC 1/2] crypto: ti: Add support for SHA224/256/384/512 in DTHE V2 driver T Pratham
2025-02-19 18:36 ` Kamlesh Gurudasani
2025-03-02 8:09 ` Herbert Xu
2025-04-02 13:31 ` T Pratham
2025-04-02 13:54 ` Herbert Xu
2025-04-02 14:12 ` T Pratham
2025-04-02 14:16 ` Herbert Xu
2025-04-03 8:28 ` T Pratham
2025-04-03 8:35 ` Herbert Xu
2025-04-04 10:15 ` T Pratham
2025-04-04 10:23 ` Herbert Xu
2025-04-04 12:40 ` T Pratham [this message]
2025-04-05 1:33 ` Herbert Xu
2025-04-05 1:36 ` Herbert Xu
2025-02-18 10:49 ` [PATCH RFC 2/2] crypto: ti: Add support for MD5 in DTHE V2 Hashing Engine driver T Pratham
2025-02-19 18:47 ` Kamlesh Gurudasani
2025-04-02 13:50 ` Herbert Xu
2025-04-02 14:21 ` 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=8536cdf7-f4bd-4f9a-9eaf-9e38fba67741@ti.com \
--to=t-pratham@ti.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--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=vigneshr@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®