lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/4] crypto: starfive - Add hash and HMAC support
On Mon, Mar 13, 2023 at 09:56:46PM +0800, Jia Jie Ho wrote:
>
> +static int starfive_hash_update(struct ahash_request *req)
> +{
> + struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req);
> + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
> + struct starfive_cryp_ctx *ctx = crypto_ahash_ctx(tfm);
> +
> + ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk);
> + rctx->ahash_fbk_req.base.flags = req->base.flags
> + & CRYPTO_TFM_REQ_MAY_SLEEP;
> + rctx->ahash_fbk_req.nbytes = req->nbytes;
> + rctx->ahash_fbk_req.src = req->src;

Please don't modify the fields directly, use the ahash_request_set_*
helpers. Since you allocated an async fallback, you should set the
callbacks too.

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

\
 
 \ /
  Last update: 2023-03-27 01:16    [W:0.144 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site