Linux cryptographic layer development
 help / color / mirror / Atom feed
* CMAC fallback failures from SPAcc driver
@ 2026-10-07  9:21 Pavitrakumar Managutte
  2026-10-07 10:24 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: Pavitrakumar Managutte @ 2026-10-07  9:21 UTC (permalink / raw)
  To: Eric Biggers
  Cc: Herbert Xu, linux-crypto, Derwig, Ruud, Ross Bannerman,
	Nazim Khan, Navami R Telsang

Hi Eric,
   While bringing up the SPAcc async ahash hardware driver against
7.3-rc1, cmac(aes) and xcbc(aes) fail their self-tests during TFM
allocation.

I did some digging and it looks like this is due to the missing
export_core/import_core functions in the cmac software
implementations. I see that all other hash algos have
export_core/import_core functions except cmacs. Is it intentional?

For cmac(aes)/xcbc(aes) it fails. In crypto/ahash.c,
crypto_ahash_init_tfm() allocates the fallback with:

    fb = crypto_alloc_ahash(name, CRYPTO_ALG_REQ_VIRT,
                       CRYPTO_ALG_ASYNC | CRYPTO_ALG_REQ_VIRT |
                       CRYPTO_AHASH_ALG_NO_EXPORT_CORE);

i.e. it requires a fallback that is synchronous, virtual-address
capable, and has NO_EXPORT_CORE clear.

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 classic 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 fallback candidate and returns
-EINVAL:

  alg: hash: failed to allocate transform for spacc-cmac(aes): -22

BTW for SPAcc incremental(init/update/final) path, we always use the
software fallbacks since SPAcc hardware cannot export or import the
intermediate MAC state. Herbert suggested this.

Warm regards,
PK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-07 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07  9:21 CMAC fallback failures from SPAcc driver Pavitrakumar Managutte
2026-10-07 10:24 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox