[PATCH 01/13] crypto/cnxk: fix length of AES-CMAC algo

Tejasree Kondoj ktejasree at marvell.com
Wed Oct 19 16:15:01 CEST 2022


AES-CMAC uses PDCP opcode. Length should be passed
in bits.

Fixes: 759b5e653580 ("crypto/cnxk: support AES-CMAC")

Signed-off-by: Tejasree Kondoj <ktejasree at marvell.com>
---
 drivers/crypto/cnxk/cnxk_se.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index 54a78d0a5a..c92e2cca2f 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -1323,6 +1323,9 @@ cpt_pdcp_alg_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens,
 			auth_offset += iv_len;
 
 			inputlen = auth_offset + auth_data_len;
+
+			/* length should be in bits */
+			auth_data_len *= 8;
 		}
 
 		outputlen = mac_len;
-- 
2.25.1



More information about the dev mailing list