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: Wed, 2 Apr 2025 19:01:25 +0530 [thread overview]
Message-ID: <f7105c10-7e36-4914-a9e8-e83eb61f0189@ti.com> (raw)
In-Reply-To: <Z8QSVLoucZxG1xlc@gondor.apana.org.au>
Hi Herbert
On 02/03/25 13:39, Herbert Xu wrote:
> On Tue, Feb 18, 2025 at 04:19:42PM +0530, T Pratham wrote:
>> +struct dthe_hash_ctx {
>> + enum dthe_hash_algSel mode;
>> + u16 block_size;
>> + u8 digest_size;
>> + u8 phash_available;
>> + u32 phash[SHA512_DIGEST_SIZE / sizeof(u32)];
> Is this format identical to the software sha512 hash? If so please
> make the export/import functions translate to and from struct
> sha512_state.
>
> That way we can export and resume using the software sha512 in case
> something goes wrong (e.g., memory allocation failure).
>
> Ditto with all the other hash algorithms.
>
> Thanks,
I noticed that you are making changes to the export format of hash
algorithms (s390 hmac
<https://lore.kernel.org/linux-crypto/Z-AJFwndherQBH2W@gondor.apana.org.au/#r>,
caam hashing
<https://lore.kernel.org/linux-crypto/Z-AJx1oPRE2_X1GE@gondor.apana.org.au/#r>).
I was in process of finalizing my driver for a v2 and had some queries
about the above feedback from you.
In my dthe_hash_ctx struct below:
+struct dthe_hash_ctx { + enum dthe_hash_algSel mode; + u16 block_size;
+ u8 digest_size; + u8 phash_available; + u32 phash[SHA512_DIGEST_SIZE /
sizeof(u32)]; + u32 phash_size; + u32 digestcnt; + u8
data_buf[SHA512_BLOCK_SIZE]; + u8 buflen; + struct completion
hash_compl; +};
You are correct in the sense that the format is /mostly/ identical to
struct sha512_state. phash[], data_buf[] and digestcnt are same as in
sha512_state. Rest of the members I can reinitialize at import. The only
one which stores some kind of state is *buflen*, which requires its
value to be restored while importing. The current driver implementation
processes input in multiples of block size and stores the remainder data
in data_buf[] if the input is not a multiple of block size. buflen has
the length of data in data_buf[].
How are you planning to restore such states in import if the export is
to be made compatible with sha512_state? Do you have any pointers for me
on how to change the import/export before sending the next revision of
my driver?
Regards
T Pratham <t-pratham@ti.com>
next prev parent reply other threads:[~2025-04-02 13:31 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 [this message]
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
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=f7105c10-7e36-4914-a9e8-e83eb61f0189@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®