Skip to content

Commit

Permalink
crypto: inside-secure - Fix build error with CONFIG_CRYPTO_SM3=m
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Pascal van Leeuwen authored and herbertx committed Oct 23, 2019
1 parent 5b243b6 commit 756497c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/crypto/inside-secure/safexcel_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 756497c

Please sign in to comment.