mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Kai Ye <yekai13@huawei.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	wangzhou1@hisilicon.com, liulongfang@huawei.com
Subject: Re: [PATCH v3 2/6] crypto: hisilicon/sec - add ahash alg features for Kunpeng920
Date: Sat, 13 Nov 2021 14:01:19 +0800	[thread overview]
Message-ID: <20211113060119.GA21020@gondor.apana.org.au> (raw)
In-Reply-To: <20211022091055.15369-3-yekai13@huawei.com>

On Fri, Oct 22, 2021 at 05:10:51PM +0800, Kai Ye wrote:
>
> +static int sec_ahash_export(struct ahash_request *req, void *out)
> +{
> +	/*
> +	 * This function dumps the
> +	 * entire state of the ongoing transformation into a provided block of
> +	 * data so it can be @import'ed back later on.
> +	 */
> +	struct sec_req *sreq = ahash_request_ctx(req);
> +	struct sec_auth_ctx *a_ctx = &sreq->ctx->a_ctx;
> +	u8 mac_len = a_ctx->mac_len;
> +
> +	memcpy(out, &sreq->hash_req, sizeof(struct sec_ahash_req));

So this structure seems to contain a bunch of metadata but not
the actual hash state.

> +	/* Export the partial hash data */
> +	memcpy(out + sizeof(struct sec_ahash_req), a_ctx->metamac, mac_len);

This looks like it could be the hash state, but mac_len is clamped
at digest size so it's way too small to contain the entire hash
state.

How is this supposed to work?

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2021-11-13  6:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  9:10 [PATCH v3 0/6] crypto: hisilicon - supports hash algorithm for SEC engine Kai Ye
2021-10-22  9:10 ` [PATCH v3 1/6] crypto: hisilicon/sec - add ping-pong buffer for ahash Kai Ye
2021-10-22  9:10 ` [PATCH v3 2/6] crypto: hisilicon/sec - add ahash alg features for Kunpeng920 Kai Ye
2021-11-13  6:01   ` Herbert Xu [this message]
2021-10-22  9:10 ` [PATCH v3 3/6] crypto: hisilicon/sec - support the larger packets for digest mode Kai Ye
2021-10-22  9:10 ` [PATCH v3 4/6] crypto: hisilicon/sec - ahash adapt to Kunpeng930 SQE Kai Ye
2021-10-22  9:10 ` [PATCH v3 5/6] crypto: hisilicon/sec - add fallback tfm supporting for ahash Kai Ye
2021-10-22  9:10 ` [PATCH v3 6/6] crypto: hisilicon/sec - add sm3/md5 generic selection " Kai Ye
2021-10-30  1:06 ` [PATCH v3 0/6] crypto: hisilicon - supports hash algorithm for SEC engine yekai(A)
2021-11-02  3:52   ` Herbert Xu

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=20211113060119.GA21020@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liulongfang@huawei.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=yekai13@huawei.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®