Re: [PATCH v25 2/4] crypto: spacc - Add SPAcc ahash support
From: Herbert Xu
Date: Thu Oct 08 2026 - 04:40:56 EST
On Fri, Oct 02, 2026 at 10:42:44AM +0530, Pavitrakumar Managutte wrote:
> Hi Herbert,
> My comments are embedded below.
>
> Also while bringing up an async ahash SPAcc driver against 7.3-rc1,
> cmac(aes) and xcbc(aes) fail their self-tests at tfm allocation, and
> I'd like to understand whether the underlying cause is intentional
> before I work around it in the driver.
>
> All tests pass for every hash and HMAC we register, except cmac(aes)
> and xcbc(aes). For cmac(aes)/xcbc(aes) it fails.
>
> crypto_ahash_init_tfm() allocates the fallback with:
>
> crypto_alloc_ahash(name, CRYPTO_ALG_REQ_VIRT,
> CRYPTO_ALG_ASYNC | CRYPTO_ALG_REQ_VIRT |
> CRYPTO_AHASH_ALG_NO_EXPORT_CORE);
>
> On our tree no cmac(aes)/xcbc(aes) provider satisfies that: with both
> CONFIG_CRYPTO_CMAC/XCBC=y and CONFIG_CRYPTO_LIB_AES_CBC_MACS=y,
> neither the crypto/cmac.c template nor the new AES-CMAC library shash
> implements export_core/import_core, so both report NO_EXPORT_CORE. The
> allocation finds no candidate and returns -EINVAL.
>
> alg: hash: failed to allocate transform for spacc-cmac(aes): -22
>
> The library shash matches ASYNC=0 and REQ_VIRT but is rejected on
> NO_EXPORT_CORE. No candidate remains. CONFIG_CRYPTO_SELFTESTS_FULL=y,
> so this is hit deterministically.
>
> This looks like the case flagged in "crypto: sha256 - Implement
> export_core() and import_core()" (Eric, Sep 2025), which notes that
> since
> commit 9d7a0ab1c753 export_core/import_core "effectively became
> mandatory... since legacy drivers that need a fallback depend on
> them."
> sha256/sha512/md5/hmac gained export_core, but cmac(aes)/xcbc(aes) did not.
>
> Is the absence of export_core/import_core on cmac(aes)/xcbc(aes)
> intentional -- i.e. async offload drivers must not rely on the core
> software fallback for these MACs -- or is it an oversight that should
> be addressed the way sha256 was?
I will fix this up.
Thanks for letting me know.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt