From: sashiko-bot@kernel.org
To: "Depei Yang" <yangdepei@hygon.cn>, linux-crypto@vger.kernel.org
Cc: "Tom Lendacky" <thomas.lendacky@amd.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
"Gary R Hook" <gary.hook@amd.com>,
"Shan Chen" <chenshan@hygon.cn>,
"Yongwei Xu" <xuyongwei@hygon.cn>,
"Xiaochen Shen" <shenxiaochen@hygon.cn>
Subject: Re: [PATCH 11/11] crypto: ccp - add SM3 engine and ahash algorithms
Date: Wed, 25 Nov 2026 08:10:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-232867@kernel.org> (raw)
In-Reply-To: <7cc3e8096373670b553d0e469b245b444d295ff7.1795588986.git.yangdepei@hygon.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] crypto: ccp: missing CRYPTO_HMAC select breaks hmac(sm3)
fallback init
--
commit f58b08a6f33547b17d76105dad73af6381c5f603
Author: Depei Yang <yangdepei@hygon.cn>
crypto: ccp - add SM3 engine and ahash algorithms
This commit adds the SM3 engine command builder, request handling, and
sm3 and hmac(sm3) ahash algorithms to the CCP driver.
> diff --git a/drivers/crypto/ccp/Kconfig b/drivers/crypto/ccp/Kconfig
> index f16a0f6113175..a226720201fe8 100644
> --- a/drivers/crypto/ccp/Kconfig
> +++ b/drivers/crypto/ccp/Kconfig
> @@ -15,6 +15,7 @@ config CRYPTO_DEV_SP_CCP
> select DMA_ENGINE
> select CRYPTO_SHA1
> select CRYPTO_SHA256
> + select CRYPTO_SM3
> help
> Provides the support for AMD Cryptographic Coprocessor (CCP) device
> which can be used to offload encryption operations such as SHA, AES
[Severity: Medium]
Should CRYPTO_DEV_SP_CCP (or CRYPTO_DEV_CCP_CRYPTO) also select
CRYPTO_HMAC?
ccp_register_sm3_alg() and ccp_register_hmac_sm3_alg() register
hmac-sm3-ccp with CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK, so
crypto_ahash_init_tfm() allocates a synchronous fallback for hmac(sm3)
whenever a transform is initialized (including during registration
self-tests). Unlike CRYPTO_SHA1 and CRYPTO_SHA256, which directly
register synchronous hmac(sha*) shash algorithms, CRYPTO_SM3 only
registers sm3-lib and relies on the hmac template from CONFIG_CRYPTO_HMAC
to provide hmac(sm3). Without CONFIG_CRYPTO_HMAC enabled, allocating
hmac(sm3) fails with -ENOENT.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795588986.git.yangdepei@hygon.cn?part=11
prev parent reply other threads:[~2026-11-25 8:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 7:45 [PATCH 00/11] crypto: ccp - add Hygon SM3/SM4 support Depei Yang
2026-11-25 7:45 ` [PATCH 01/11] crypto: ccp - fix LSB region mask calculation Depei Yang
2026-11-25 7:46 ` [PATCH 02/11] crypto: ccp - acknowledge queue interrupt before waking waiter Depei Yang
2026-11-25 7:46 ` [PATCH 03/11] crypto: ccp - add engine capability and version information Depei Yang
2026-11-25 7:55 ` sashiko-bot
2026-11-25 7:46 ` [PATCH 04/11] crypto: ccp - register algorithms only for supported engines Depei Yang
2026-11-25 7:46 ` [PATCH 05/11] crypto: ccp - split v5 command submission from queue run Depei Yang
2026-11-25 7:46 ` [PATCH 06/11] crypto: ccp - add SM3/SM4 command definitions Depei Yang
2026-11-25 7:46 ` [PATCH 07/11] crypto: ccp - add Hygon CCP device IDs and vdata Depei Yang
2026-11-25 7:46 ` [PATCH 08/11] crypto: ccp - handle only supported interrupts in v5 irq bh Depei Yang
2026-11-25 7:46 ` [PATCH 09/11] crypto: ccp - detect the Hygon CCP engines from the version register Depei Yang
2026-11-25 7:46 ` [PATCH 10/11] crypto: ccp - add SM4 engine and skcipher algorithms Depei Yang
2026-11-25 8:11 ` sashiko-bot
2026-11-25 7:46 ` [PATCH 11/11] crypto: ccp - add SM3 engine and ahash algorithms Depei Yang
2026-11-25 8:10 ` sashiko-bot [this message]
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=sashiko-outbox-232867@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chenshan@hygon.cn \
--cc=davem@davemloft.net \
--cc=gary.hook@amd.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shenxiaochen@hygon.cn \
--cc=thomas.lendacky@amd.com \
--cc=xuyongwei@hygon.cn \
--cc=yangdepei@hygon.cn \
/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 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.