linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@google.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stefan Agner <stefan@agner.ch>
Cc: bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH] crypto: bcm: fix normal/non key hash algorithm failure
Date: Tue, 6 Nov 2018 10:02:47 -0800	[thread overview]
Message-ID: <dbac8a57-a1dd-1926-624f-cdbb2e4f6dff@gmail.com> (raw)
In-Reply-To: <1541492938-29261-1-git-send-email-raveendra.padasalagi@broadcom.com>

On 11/6/18 12:28 AM, Raveendra Padasalagi wrote:
> Remove setkey() callback handler for normal/non key
> hash algorithms and keep it for AES-CBC/CMAC which needs key.
> 
> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>

Should this have the following Fixes tag?

Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver")

> ---
>  drivers/crypto/bcm/cipher.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
> index 2d1f1db..4d67e22 100644
> --- a/drivers/crypto/bcm/cipher.c
> +++ b/drivers/crypto/bcm/cipher.c
> @@ -4652,12 +4652,16 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg)
>  	hash->halg.statesize = sizeof(struct spu_hash_export_s);
>  
>  	if (driver_alg->auth_info.mode != HASH_MODE_HMAC) {
> -		hash->setkey = ahash_setkey;
>  		hash->init = ahash_init;
>  		hash->update = ahash_update;
>  		hash->final = ahash_final;
>  		hash->finup = ahash_finup;
>  		hash->digest = ahash_digest;
> +		if ((driver_alg->auth_info.alg == HASH_ALG_AES) &&
> +		    ((driver_alg->auth_info.mode == HASH_MODE_XCBC) ||
> +		    (driver_alg->auth_info.mode == HASH_MODE_CMAC))) {
> +			hash->setkey = ahash_setkey;
> +		}
>  	} else {
>  		hash->setkey = ahash_hmac_setkey;
>  		hash->init = ahash_hmac_init;
> 


-- 
Florian

  reply	other threads:[~2018-11-06 18:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  8:28 [PATCH] crypto: bcm: fix normal/non key hash algorithm failure Raveendra Padasalagi
2018-11-06 18:02 ` Florian Fainelli [this message]
2018-11-16  6:18   ` 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=dbac8a57-a1dd-1926-624f-cdbb2e4f6dff@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raveendra.padasalagi@broadcom.com \
    --cc=stefan@agner.ch \
    /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).