[PATCH] crypto: tegra: Add crypto config in tegra_cmac_do_final()

Wentao Liang posted 1 patch 6 months, 3 weeks ago
drivers/crypto/tegra/tegra-se-aes.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] crypto: tegra: Add crypto config in tegra_cmac_do_final()
Posted by Wentao Liang 6 months, 3 weeks ago
The function tegra_cmac_do_final() calls the function tegra234_aes_cfg(),
but does not call tegra234_aes_crypto_cfg() to have a crypto
configuration. A proper implementation can be found in
tegra_ccm_do_ctr().

Add the tegra234_aes_crypto_cfg() for configuration.

Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/crypto/tegra/tegra-se-aes.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c
index 9d130592cc0a..e01653985a31 100644
--- a/drivers/crypto/tegra/tegra-se-aes.c
+++ b/drivers/crypto/tegra/tegra-se-aes.c
@@ -1550,6 +1550,8 @@ static int tegra_cmac_do_final(struct ahash_request *req)
 	rctx->datbuf.size = rctx->residue.size;
 	rctx->total_len += rctx->residue.size;
 	rctx->config = tegra234_aes_cfg(SE_ALG_CMAC, 0);
+	rctx->crypto_config = tegra234_aes_crypto_cfg(SE_ALG_CMAC, 0) |
+		SE_AES_KEY_INDEX(ctx->key_id);
 
 	/* Prepare command and submit */
 	cmdlen = tegra_cmac_prep_cmd(ctx, rctx);
-- 
2.42.0.windows.2
Re: [PATCH] crypto: tegra: Add crypto config in tegra_cmac_do_final()
Posted by Herbert Xu 6 months ago
On Mon, May 26, 2025 at 10:04:02AM +0800, Wentao Liang wrote:
> The function tegra_cmac_do_final() calls the function tegra234_aes_cfg(),
> but does not call tegra234_aes_crypto_cfg() to have a crypto
> configuration. A proper implementation can be found in
> tegra_ccm_do_ctr().
> 
> Add the tegra234_aes_crypto_cfg() for configuration.
> 
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/crypto/tegra/tegra-se-aes.c | 2 ++
>  1 file changed, 2 insertions(+)

So did this fail during the self-test? Please provide the before
and after self-test results.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt