DPDK patches and discussions
 help / color / mirror / Atom feed
From: Emma Finn <emma.finn@intel.com>
To: Kai Ji <kai.ji@intel.com>, Fiona Trahe <fiona.trahe@intel.com>,
	Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>,
	Fan Zhang <fanzhang.oss@gmail.com>
Cc: dev@dpdk.org, Emma Finn <emma.finn@intel.com>
Subject: [v3 1/2] crypto/qat: fix CCM request descriptor hash_state_sz field
Date: Wed, 12 Nov 2025 10:19:10 +0000	[thread overview]
Message-ID: <20251112101911.2377840-1-emma.finn@intel.com> (raw)
In-Reply-To: <20251110170107.2296951-1-emma.finn@intel.com>

The hash_state_sz field in the QAT request descriptor for AES-CCM
operations was incorrectly set to the digest length. According to
the QAT firmware specification, this field should contain the
length of AAD in quadwords for CCM operations.

Fixes: ab56c4d9ed9a ("crypto/qat: support AES-CCM")

Signed-off-by: Emma Finn <emma.finn@intel.com>
---
v2:
 * Updated to use 16-byte alignment.
v3:
 * split into two patches.
---
 drivers/crypto/qat/qat_sym_session.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 98ab82ffb3..2ba4fc0a3a 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -2774,7 +2774,8 @@ static int qat_sym_cd_auth_set(struct qat_sym_session *cdesc,
 		hash->auth_counter.counter = 0;
 
 		hash_cd_ctrl->outer_prefix_sz = digestsize;
-		auth_param->hash_state_sz = digestsize;
+		auth_param->hash_state_sz = (RTE_ALIGN_CEIL(auth_param->u2.aad_sz,
+						ICP_QAT_HW_CCM_AAD_ALIGNMENT) >> 3);
 
 		memcpy(cdesc->cd_cur_ptr + state1_size, authkey, authkeylen);
 		break;
-- 
2.34.1


  parent reply	other threads:[~2025-11-12 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 16:23 [PATCH] " Emma Finn
2025-11-07 16:43 ` Emma Finn
2025-11-10 17:01   ` [v2] " Emma Finn
2025-11-11 14:44     ` Ji, Kai
2025-11-12  4:08       ` Akhil Goyal
2025-11-12 10:19     ` Emma Finn [this message]
2025-11-12 10:19       ` [v3 2/2] test/crypto: add QAT AES-CCM test case Emma Finn

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=20251112101911.2377840-1-emma.finn@intel.com \
    --to=emma.finn@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=fiona.trahe@intel.com \
    --cc=kai.ji@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).