Linux cryptographic layer development
 help / color / mirror / Atom feed
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-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH v3 1/3] crypto: ti - Add support for SHA224/256/384/512 in DTHEv2 driver
Date: Mon, 18 May 2026 19:05:04 +0530	[thread overview]
Message-ID: <e3612486-20ee-4c0c-b5f5-677ee9f724dd@ti.com> (raw)
In-Reply-To: <abTdJSPtLYN0VJWm@gondor.apana.org.au>

On 3/14/26 09:29, Herbert Xu wrote:
> On Thu, Feb 26, 2026 at 06:41:01PM +0530, T Pratham wrote:
>>
>> +static int dthe_hash_export(struct ahash_request *req, void *out)
>> +{
>> +	struct dthe_hash_req_ctx *rctx = ahash_request_ctx(req);
>> +	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
>> +	struct dthe_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
>> +	union {
>> +		u8 *u8;
>> +		u64 *u64;
>> +	} p = { .u8 = out };
>> +
>> +	memcpy(out, rctx->phash, ctx->phash_size);
>> +	p.u8 += ctx->phash_size;
>> +	put_unaligned(rctx->digestcnt[0], p.u64++);
>> +	if (ctx->phash_size >= SHA512_DIGEST_SIZE)
>> +		put_unaligned(rctx->digestcnt[1], p.u64++);
>> +
>> +	return 0;
>> +}
> 
> The hash state must always be exported, even right after initialisation.
> So you need to export the initial SHA stats if phash_available is
> false.
> 
> Cheers,

Hi,
I fixed the above and will send a new patch. But I had a question.
What is the expected export/import format for HMAC algorithms? Can't
seem to find a struct similar to sha512_state/sha256_state for hmac.

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

  reply	other threads:[~2026-05-18 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 13:11 [PATCH v3 0/3] Add support for hashing algorithms in TI DTHE V2 T Pratham
2026-02-26 13:11 ` [PATCH v3 1/3] crypto: ti - Add support for SHA224/256/384/512 in DTHEv2 driver T Pratham
2026-03-14  3:59   ` Herbert Xu
2026-05-18 13:35     ` T Pratham [this message]
2026-05-19  4:24       ` Herbert Xu
2026-02-26 13:11 ` [PATCH v3 2/3] crypto: ti - Add support for MD5 in DTHEv2 Hashing Engine driver T Pratham
2026-02-26 13:11 ` [PATCH v3 3/3] crypto: ti - Add support for HMAC " 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=e3612486-20ee-4c0c-b5f5-677ee9f724dd@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