Re: [PATCH] sample/tsm-mr: Use SHA-2 library APIs
From: Arnd Bergmann
Date: Wed Mar 18 2026 - 16:00:27 EST
On Wed, Mar 18, 2026, at 17:42, Eric Biggers wrote:
> Given that tsm_mr_sample has a particular set of algorithms that it
> wants, just use the library APIs for those algorithms rather than
> crypto_shash. This is more straightforward and a bit more efficient.
>
> This fixes an issue where this module failed to build due to the kconfig
> options CRYPTO and CRYPTO_HASH not being selected. Also, even if it
> built, crypto_alloc_shash() could fail at runtime due to the needed
> algorithms not being available.
>
> The library functions simply use direct linking. So if it builds, which
> it will due to the kconfig options being enabled, they are available.
>
> Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code")
> Fixes: 44a3873df811 ("coco/guest: Remove unneeded selection of CRYPTO")
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> ---
>
> I'd like to take this via libcrypto-next, as that is where
> "coco/guest: Remove unneeded selection of CRYPTO" is.
Thanks for fixing this! It is indeed nicer than the fix
I sent earlier today.
Acked-by: Arnd Bergmann <arnd@xxxxxxxx>