Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412110

Re: [PATCH 2/2] crypto : async implementation for sha1-mb

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] crypto : async implementation for sha1-mb
Date 2016-06-02 12:40 +0200
Message-ID <rFycF-4ML-3@gated-at.bofh.it> (permalink)
References <rEZyh-7VD-9@gated-at.bofh.it> <rEZyh-7VD-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 31, 2016 at 02:42:21PM -0700, Megha Dey wrote:
>
> @@ -416,8 +421,8 @@ static void mcryptd_hash_finup(struct crypto_async_request *req_async, int err)
>  
>  	if (unlikely(err == -EINPROGRESS))
>  		goto out;
> -
> -	err = shash_ahash_mcryptd_finup(req, &rctx->desc);
> +	rctx->out = req->result;
> +	err = shash_ahash_mcryptd_finup(req, &rctx->areq);

These shash_ahash functions should be renamed.

Also why are they exported?

> @@ -439,17 +444,18 @@ static int mcryptd_hash_finup_enqueue(struct ahash_request *req)
>  static void mcryptd_hash_digest(struct crypto_async_request *req_async, int err)
>  {
>  	struct mcryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm);
> -	struct crypto_shash *child = ctx->child;
> +	struct crypto_ahash *child = ctx->child;
>  	struct ahash_request *req = ahash_request_cast(req_async);
>  	struct mcryptd_hash_request_ctx *rctx = ahash_request_ctx(req);
> -	struct shash_desc *desc = &rctx->desc;
> +	struct ahash_request *desc = &rctx->areq;
> +	struct crypto_async_request *base = &desc->base;
>  
>  	if (unlikely(err == -EINPROGRESS))
>  		goto out;
> +	base->tfm = &child->base;
> +	base->flags = CRYPTO_TFM_REQ_MAY_SLEEP;  /* check this again */

You should not be touching crypto_async_request directly.  Use
the proper ahash interface to set the child request.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] crypto : async implementation for sha1-mb Megha Dey <megha.dey@intel.com> - 2016-05-31 23:40 +0200
  Re: [PATCH 2/2] crypto : async implementation for sha1-mb Herbert Xu <herbert@gondor.apana.org.au> - 2016-06-02 12:40 +0200
    Re: [PATCH 2/2] crypto : async implementation for sha1-mb Megha Dey <megha.dey@intel.com> - 2016-06-02 19:20 +0200
      Re: [PATCH 2/2] crypto : async implementation for sha1-mb Herbert Xu <herbert@gondor.apana.org.au> - 2016-06-03 02:40 +0200
        RE: [PATCH 2/2] crypto : async implementation for sha1-mb "Dey, Megha" <megha.dey@intel.com> - 2016-06-03 05:00 +0200

csiph-web