summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPascal van Leeuwen <pascalvanl@gmail.com>2019-10-17 17:36:28 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-23 10:47:01 +0200
commit756497cb7be2fee4e71b77ae140c1537e963e794 (patch)
tree430d65f55913779df48f6bbd234d857eb83d2bac /drivers
parentcrypto: hisilicon: Fix misuse of GENMASK macro (diff)
downloadlinux-756497cb7be2fee4e71b77ae140c1537e963e794.tar.xz
linux-756497cb7be2fee4e71b77ae140c1537e963e794.zip
crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m
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. Fixes: 0f2bc13181ce ("crypto: inside-secure - Added support for...") Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/inside-secure/safexcel_hash.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index a07a2915fab1..b60f9fbd4017 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;