All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m
@ 2019-10-17 15:36 Pascal van Leeuwen
  2019-10-18  8:07 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Pascal van Leeuwen @ 2019-10-17 15:36 UTC (permalink / raw)
  To: linux-crypto; +Cc: antoine.tenart, herbert, davem, Pascal van Leeuwen

Always take the zero length hash value for SM3 from the local constant
to avoid a reported build error when SM3 is configured to be a module.

Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
---
 drivers/crypto/inside-secure/safexcel_hash.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 85c3a07..c906509a 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -785,12 +785,8 @@ static int safexcel_ahash_final(struct ahash_request *areq)
 			memcpy(areq->result, sha512_zero_message_hash,
 			       SHA512_DIGEST_SIZE);
 		else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SM3) {
-			if (IS_ENABLED(CONFIG_CRYPTO_SM3))
-				memcpy(areq->result, sm3_zero_message_hash,
-				       SM3_DIGEST_SIZE);
-			else
-				memcpy(areq->result,
-				       EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE);
+			memcpy(areq->result,
+			       EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE);
 		}
 
 		return 0;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m
  2019-10-17 15:36 [PATCH] crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m Pascal van Leeuwen
@ 2019-10-18  8:07 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2019-10-18  8:07 UTC (permalink / raw)
  To: Pascal van Leeuwen
  Cc: linux-crypto, antoine.tenart, davem, Pascal van Leeuwen

On Thu, Oct 17, 2019 at 05:36:28PM +0200, Pascal van Leeuwen wrote:
> Always take the zero length hash value for SM3 from the local constant
> to avoid a reported build error when SM3 is configured to be a module.
> 
> Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Patch applied.  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-18  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 15:36 [PATCH] crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m Pascal van Leeuwen
2019-10-18  8:07 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.