linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Pavitrakumar M <pavitrakumarm@vayavyalabs.com>
Cc: linux-crypto@vger.kernel.org, Ruud.Derwig@synopsys.com,
	manjunath.hadli@vayavyalabs.com, bhoomikak@vayavyalabs.com,
	shwetar <shwetar@vayavyalabs.com>
Subject: Re: [PATCH v5 3/7] Add SPAcc ahash support
Date: Fri, 28 Jun 2024 11:16:05 +1000	[thread overview]
Message-ID: <Zn4O1bCwLLc8kk1N@gondor.apana.org.au> (raw)
In-Reply-To: <20240621082053.638952-4-pavitrakumarm@vayavyalabs.com>

On Fri, Jun 21, 2024 at 01:50:49PM +0530, Pavitrakumar M wrote:
>
> +static int spacc_hash_cra_init(struct crypto_tfm *tfm)
> +{
> +	const struct spacc_alg *salg = spacc_tfm_ahash(tfm);
> +	struct spacc_crypto_ctx *tctx = crypto_tfm_ctx(tfm);
> +	struct spacc_priv *priv = NULL;
> +
> +	tctx->handle    = -1;
> +	tctx->ctx_valid = false;
> +	tctx->dev       = get_device(salg->dev[0]);
> +
> +	if (salg->mode->sw_fb) {
> +		tctx->fb.hash = crypto_alloc_ahash(salg->calg->cra_name, 0,
> +						   CRYPTO_ALG_NEED_FALLBACK);
> +
> +		if (IS_ERR(tctx->fb.hash)) {
> +			if (tctx->handle >= 0)
> +				spacc_close(&priv->spacc, tctx->handle);
> +			put_device(tctx->dev);
> +			return PTR_ERR(tctx->fb.hash);
> +		}
> +
> +		crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
> +					 sizeof(struct spacc_crypto_reqctx) +
> +					 crypto_ahash_reqsize(tctx->fb.hash));

You should also set the statesize here.

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:[~2024-06-28  1:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-21  8:20 [PATCH v5 0/7] Add SPAcc Crypto Driver Support Pavitrakumar M
2024-06-21  8:20 ` [PATCH v5 1/7] Add SPAcc Skcipher support Pavitrakumar M
2024-06-21  8:20 ` [PATCH v5 2/7] Enable SPAcc AUTODETECT Pavitrakumar M
2024-06-21  8:20 ` [PATCH v5 3/7] Add SPAcc ahash support Pavitrakumar M
2024-06-28  1:16   ` Herbert Xu [this message]
2024-07-09 20:30     ` Pavitrakumar Managutte
2024-06-21  8:20 ` [PATCH v5 4/7] Add SPAcc aead support Pavitrakumar M
2024-06-21  8:20 ` [PATCH v5 5/7] Add SPAcc Kconfig and Makefile Pavitrakumar M
2024-06-21  8:20 ` [PATCH v5 6/7] Add SPAcc dts overlay Pavitrakumar M
2024-08-20 16:24   ` Conor Dooley
2024-08-20 17:13     ` Pavitrakumar Managutte
2024-06-21  8:20 ` [PATCH v5 7/7] Enable Driver compilation in crypto Kconfig and Makefile Pavitrakumar M
2024-07-01 15:43   ` Dan Carpenter

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=Zn4O1bCwLLc8kk1N@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Ruud.Derwig@synopsys.com \
    --cc=bhoomikak@vayavyalabs.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=manjunath.hadli@vayavyalabs.com \
    --cc=pavitrakumarm@vayavyalabs.com \
    --cc=shwetar@vayavyalabs.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;
as well as URLs for NNTP newsgroup(s).