Re: [PATCH v5 3/7] Add SPAcc ahash support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Herbert,
  The statesize is taken care of in V6 patchset.
  Appreciate your feedback and review on the same.

Warm regards,
PK


On Fri, Jun 28, 2024 at 6:46 AM Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux