Skip to content

Commit 756497c

Browse files
Pascal van Leeuwenherbertx
authored andcommitted
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: 0f2bc13 ("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>
1 parent 5b243b6 commit 756497c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎drivers/crypto/inside-secure/safexcel_hash.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -785,12 +785,8 @@ static int safexcel_ahash_final(struct ahash_request *areq)
785785
memcpy(areq->result, sha512_zero_message_hash,
786786
SHA512_DIGEST_SIZE);
787787
else if (ctx->alg == CONTEXT_CONTROL_CRYPTO_ALG_SM3) {
788-
if (IS_ENABLED(CONFIG_CRYPTO_SM3))
789-
memcpy(areq->result, sm3_zero_message_hash,
790-
SM3_DIGEST_SIZE);
791-
else
792-
memcpy(areq->result,
793-
EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE);
788+
memcpy(areq->result,
789+
EIP197_SM3_ZEROM_HASH, SM3_DIGEST_SIZE);
794790
}
795791

796792
return 0;

0 commit comments

Comments
 (0)