From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0071.outbound.protection.outlook.com [104.47.32.71]) by dpdk.org (Postfix) with ESMTP id 75A871B1C4 for ; Fri, 5 Jan 2018 10:40:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tnzh7hBhyIfi4eotyEZtpNNXp3400fcGw0QCG1omijg=; b=SPASnn4cdKpmfAKjWGNqgvvhGDzSfdxxZF1DzCc6ZDNZzsbmyJRJOiLUwMJ1XgoOJKDWhAV9VbgBmrVk+dF74b96eVZ6TQQghNOLvpyUyMf/xQuKurSrUQcfgjaTJH5w8FlPfzWBIx3dBYCF0JMBJD+4tjUGkhAQrgkvfcLmLUI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:40:39 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 5 Jan 2018 04:39:49 -0500 Message-Id: <1515145198-97367-11-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047553-118101-1-git-send-email-Ravi1.kumar@amd.com> <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: PN1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (10.174.144.152) To BN6PR12MB1508.namprd12.prod.outlook.com (10.172.24.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e5986de8-cd88-4477-bcd0-08d5542061d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1508; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 3:fz+bQLKTUdXSWGtfx2iEdVa2c6RsQl7QhQAiU6K7l5EKPDbquRzAHAADd35Gq2xsYi/Ls0slf1mWTf4yabkrUNCflSRyIdWZRG9EdOJlRyeQEPHZI+IpcBN77bM6BooOvuC+2vjMjQng6hIc+i5M330ZzBfa6g5io7s+z9h0pt983Cvelg0spC1RADskPEb2QjhEkRXYIgtuLpfSkzHLHPG0J2MRwW1fyK5hhLtdIlcisea33tjgLRDIGG88BF1h; 25:sUl//ato0yd2zCAPZA/HRBEJYpJ5wI/KBDd+hz1EjukimP9YDMgB+92yeidf6hVJfBrX02cEiIYy68tjZgGB79L3YEdgkpDSCqYWaer4yP2EA/yLb31yo7RLLv0dtUxna585rYsOp+91NcjPTKTtWlJHvnHn+7WWkrW69+uKzmeaVsz1uytiY7HJ6ubP2gbG/eO00ZjKPxa8SmavyXEnZThGllAx8mNshx4WryDRoSwthMzZBDIaQwv3mr2hm21ODYhA+NX0BIiOAsTNjaZsd6iGwjTY9qarktyhxXkt+P92dIcywXamIQP/6sBL8ep53vrIqwvhfUHz+3Isb+eBnw==; 31:DgOtwQTShVLQ+bUQDHUPIhWMjJFFIYEpmBn9In3XFR1BlKFpsQ8XOWykXzUlp3Yaajvfl0tePCi3ag8w3CxQ7+ZSJk0qCQA2uUn0FcoML7zzICkVH0sXvm8QfLp9ah7CDnR4//KqJb/mHfLJe94VdzFuh6lpPC1BoSffkyh1diOm+ff2TDUYLZxmI54t4T/X0JCc2OK0Z0FmN2MP7Ix519LilAguMpCDEeVpt4Hvyzs= X-MS-TrafficTypeDiagnostic: BN6PR12MB1508: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 20:HACCxZs1hn2OVumbXgzIVekqJrVPwbHLHqKT7z0B/rW1mD/VWlZOe/T/vbU4qCLe1TFMI/RgYPiS5IBkpUe9EXlO6vw7yPEz6MzzDp1+yhvZUL+MAH5ILjUt1PA8sDVEBizbMEs9zJp90ayszG6OLt0/1hHwQzrDvPr4TxJCB6+GhldeB6FLmnlfIv+E70tMC88USr2D+wVAzR5Z2X9xT6Gmm00+4XaoSujN9i1EZ9E5lEWaNOZlcP7QGlQgDc3AC4ThcC0Mt4WqedF7nlgjqZk95knuW+KGzcYtIeM0Ai3rv5LEUHXeqdNylHkkaLbeq7bsWQEPrREeKIjE6Bzcjmy14rE+ketNxR1zFXf9gEPqzX9Sr8fl6kzNe17yV/l2m036PEhaXNk6C4Jy7TEQDFtXjI/vcNF0ZC3shATdIXQmjEx16EAoS+QtlKjMr29/deF4Lvd9+5GrhaQN9hh5QRV+aALGC+QGNjuS9YWvjb45q6vjxoccp5kcTGy0fLGe; 4:FC+LjQ6gvtynYrqpnI/dSvdJp32+VaigMi4G8JRNlQSZLnG0rHkrNoqCSYgmjF/bBS0Li2p3cQCTkOhA/q/gX1URvDbg8j7jfM4Hl3nJsa8Cs88WoOQEFVV5Q2NoNgsVLVRBCcAe6/Q1CHES0tulP8s1wCKoIx5ROUQ157rPbmoqQBUxe2f40ES3tOzyZD20RCk9qLWeHRafHzKvLkRfbvf1rEaX1o38dc5tx/oA7WKlKPN9SiWl8/Hfa8A5TXMg+2m1pC9bsf5pRE5+Rb6KMycHkgTeM+p9aglRyhdfz+rRXMuTkvjf7QJPNIDQAv2h X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1508; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1508; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(346002)(39380400002)(376002)(199004)(189003)(6486002)(2361001)(6116002)(106356001)(386003)(105586002)(3846002)(6916009)(2950100002)(16586007)(6666003)(16526018)(36756003)(4326008)(2906002)(316002)(97736004)(25786009)(478600001)(86362001)(68736007)(8676002)(48376002)(51416003)(81166006)(2351001)(81156014)(52116002)(8936002)(53936002)(305945005)(50226002)(76176011)(72206003)(50466002)(53416004)(7696005)(47776003)(66066001)(59450400001)(5660300001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1508; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1508; 23:QdAooBFco3nsRF9n+93Tt74M2eZI+NZfxSkIc6BkX?= =?us-ascii?Q?b4iwC62sC2ngniSL7YMbeD87jOyhoXK53PtBtTDSJbUeIv0D9UcB9Dfospkj?= =?us-ascii?Q?WDPtGvwKJS/bw8tjlA/ogH2CnAlc5FG2NOfRj7HFteidA7XyWqGYmKU0Xk+/?= =?us-ascii?Q?VyIn0xEmg8HIYmR/vKt2fEOsCCMhTnOvd46Jhu3SR52b7ESrpHPWH7Cv37mh?= =?us-ascii?Q?j+lsPu3VDiNS5dx7JA780AhtjCiWtyI+QpTYJRiWE/CFUTd2mtGUyUwJE/K6?= =?us-ascii?Q?+pytPbbBaXnZZC+3NR7pIz2MRI/nyEWZLj1guqfnhdKLFHLGTDzsfzcQx8C8?= =?us-ascii?Q?Irq3Ktf7cEsfUDHKPg3tFNrF4WfR9DBfOQZeCFoqAud4CkIi3jUiwyk3YoJV?= =?us-ascii?Q?GcpiV4TxkLs4cMtnKXtT1bH4kWGcSRGdEJcpbRWF78QCKH1FsB+7h22NTtvq?= =?us-ascii?Q?TWmU3Z+b3KpH5m9NAc2vrrEhdDf34ibhhhP8lZx97igCtfXI4JcTWuE7cY/I?= =?us-ascii?Q?gDnNLaP3hp/xN8AS3t4OIN43ojE5QDXb75z5FHVAQcQaAi6Vsww3L2SqJHa5?= =?us-ascii?Q?I2zo3v1ygysASSuPiGP8h+ZRUZRfAWJjT/CATxuV+W52kmdgD8U8oi1+8WNV?= =?us-ascii?Q?E1PBi/nVEyNmagHK/zVqTvWI094/Tuk1o4qQeUzrGm32xA/pG+sFxaa4QK6F?= =?us-ascii?Q?S1i9wuSC5dFQLwGHph9uZ81YCTOS0n+90hnFiuI5cfaaNanbYT/4Vnbdd0bu?= =?us-ascii?Q?1f+wpzjG+yb+7iVGIHSd99TmWVjf6Oh4htgfDX/RHOkQ5tKPAntcnYUwqDep?= =?us-ascii?Q?DAEskyNoWfD++DgXwhnxaQlMoLnJknfdYDi9lK4Z8opWhTERAE37NbwI9pse?= =?us-ascii?Q?5ggTr3lklZjoi36fBnGn3sTQQUdFRNobnkDy7C3Rrv3NMX3xDd0PCDgFNgzS?= =?us-ascii?Q?qTOmRElCwNPf3R8ykCTI1A4XmWlK1zla2DJKFVTg9gUZqFgXsolKvVtTDUJ5?= =?us-ascii?Q?oG55PX1o32CCU8xRP5k1JnsPW7oh9lpIzHK9EX3uu8XiMZQXALX+PCZt3yMK?= =?us-ascii?Q?BsYe/dSWPlGbqiPLSmKDbeSQGwBA1vRs3EOG7SikGU+6pvG3yFdZ78rfQHG8?= =?us-ascii?Q?d5dt+db+2S4ut5GHJkv6X49VVEZ/Lxnw7E10ZrMk9Rz7wF8xPT/4Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 6:eEkuO/J4xJPEZtDm+k9JIcbB0gE1CN/5CYoYjsugrtuDczBzxVWrfmZ+zphswrAIxX/bnxhI/IlvIKdk08om6r/KO/YdY8JAVNWMNF535T5zrojsctG1LgxxU7K659z/SkLYDHUOMMy3dWtW4zCDjUfxkBymD4COQR0z/8te4e/gdz2VJUpimxdFG84rht+AIXR0PyZp3S/hi6dqNGUWDydzd/pNdckrr/+dQQw3KIZsnqw0CjSBpPDMgEH4NhlADa5wrULL+xd3As/hPk78tFx1Yc/kXbeAJzR7eJaKpBnGFzr1xuIpwTae8Q1YNekDM+XfBE6hFzwFm87s8M97BAUlN/RuLM1WbVP4PCLB1ck=; 5:Q8a25qGX69yPg/gjCNYZiajF3yB8ChbBrcY5PON2+st2AzkuzatoyUML/Hmp4tVUZyEXAIYdM/J9bF5M394kbo7LkS+qTSjmjZps57u/fXgFc3/mm7g4flVDI8yhQjxgacRex4e/fPr5I67ESnUPNURZk60d9dkTeQlH5W+UB5M=; 24:EVqXTXGbfzqe8TjEAbnwCnf/X5W3NsXJC1u5uLDtCTfFjYyvHQO0IYdtL8eP7pisED/2dZqREUNnddorDg2uquupSFefu5Ys7wNyH4Ndv4k=; 7:REnH4bD0vYvzo9TZVcKB12y2p/Tg3jQxJxNDaN3T06JY5L0nBLPdt+MtGPzXGzynUwBDrOuiGXIzazhZAkb8whXnkTQKVlbjDHh8LmA1gsFlY28i/Ng2QpuLUScbyl5jUwfxx8XltoW8ZECtbG8M0Kr6RZIoHB4WrDjabuApAho73DAggUM12Zr5V70FJqazwqjcgviTRgbCDqPGgLiGnVAbky+kVpK9X3ngxCJVjPs0thWioSA9LPOrfYF4onvw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1508; 20:YVyv1fXtkbO+2fzoWqpd41KDYAeHEkgATId/RfT4M9EsJj4Kl8N58D61EZe9Zf2cuvBaykwdGbpdCiR4sMoggtXrQPJxCaQLgxfSlG2GA0s4kTyCtcnSH8s2mF0/GyzPQbwfMVi8UxjCcHm/H/iD3hC3MTasiA73L0gU5l1AZYjI+E6rUh3dertMpemmvdMrrxfG/d/7uQ36oWBK4VVHUwoiqe7FBc0Nx3VPZNXR6itK2lzqc1EIPXEMrch/k8lN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:40:39.0919 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5986de8-cd88-4477-bcd0-08d5542061d9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1508 Subject: [dpdk-dev] [PATCH v2 11/20] crypto/ccp: add 3des cipher algo support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2018 09:40:42 -0000 Signed-off-by: Ravi Kumar --- drivers/crypto/ccp/ccp_crypto.c | 132 ++++++++++++++++++++++++++++++++++++++- drivers/crypto/ccp/ccp_crypto.h | 3 + drivers/crypto/ccp/ccp_pmd_ops.c | 20 ++++++ 3 files changed, 154 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c index b097355..0660761 100644 --- a/drivers/crypto/ccp/ccp_crypto.c +++ b/drivers/crypto/ccp/ccp_crypto.c @@ -80,7 +80,7 @@ ccp_configure_session_cipher(struct ccp_session *sess, const struct rte_crypto_sym_xform *xform) { const struct rte_crypto_cipher_xform *cipher_xform = NULL; - size_t i; + size_t i, j, x; cipher_xform = &xform->cipher; @@ -115,6 +115,11 @@ ccp_configure_session_cipher(struct ccp_session *sess, sess->cipher.um.aes_mode = CCP_AES_MODE_CBC; sess->cipher.engine = CCP_ENGINE_AES; break; + case RTE_CRYPTO_CIPHER_3DES_CBC: + sess->cipher.algo = CCP_CIPHER_ALGO_3DES_CBC; + sess->cipher.um.des_mode = CCP_DES_MODE_CBC; + sess->cipher.engine = CCP_ENGINE_3DES; + break; default: CCP_LOG_ERR("Unsupported cipher algo"); return -1; @@ -137,6 +142,20 @@ ccp_configure_session_cipher(struct ccp_session *sess, sess->cipher.key_ccp[sess->cipher.key_length - i - 1] = sess->cipher.key[i]; break; + case CCP_ENGINE_3DES: + if (sess->cipher.key_length == 16) + sess->cipher.ut.des_type = CCP_DES_TYPE_128; + else if (sess->cipher.key_length == 24) + sess->cipher.ut.des_type = CCP_DES_TYPE_192; + else { + CCP_LOG_ERR("Invalid cipher key length"); + return -1; + } + for (j = 0, x = 0; j < sess->cipher.key_length/8; j++, x += 8) + for (i = 0; i < 8; i++) + sess->cipher.key_ccp[(8 + x) - i - 1] = + sess->cipher.key[i + x]; + break; default: CCP_LOG_ERR("Invalid CCP Engine"); return -ENOTSUP; @@ -280,6 +299,10 @@ ccp_cipher_slot(struct ccp_session *session) count = 2; /**< op + passthrough for iv */ break; + case CCP_CIPHER_ALGO_3DES_CBC: + count = 2; + /**< op + passthrough for iv */ + break; default: CCP_LOG_ERR("Unsupported cipher algo %d", session->cipher.algo); @@ -478,6 +501,109 @@ ccp_perform_aes(struct rte_crypto_op *op, return 0; } +static int +ccp_perform_3des(struct rte_crypto_op *op, + struct ccp_queue *cmd_q, + struct ccp_batch_info *b_info) +{ + struct ccp_session *session; + union ccp_function function; + unsigned char *lsb_buf; + struct ccp_passthru pst; + struct ccp_desc *desc; + uint32_t tail; + uint8_t *iv; + phys_addr_t src_addr, dest_addr, key_addr; + + session = (struct ccp_session *)get_session_private_data( + op->sym->session, + ccp_cryptodev_driver_id); + + iv = rte_crypto_op_ctod_offset(op, uint8_t *, session->iv.offset); + switch (session->cipher.um.des_mode) { + case CCP_DES_MODE_CBC: + lsb_buf = &(b_info->lsb_buf[b_info->lsb_buf_idx*CCP_SB_BYTES]); + b_info->lsb_buf_idx++; + + rte_memcpy(lsb_buf + (CCP_SB_BYTES - session->iv.length), + iv, session->iv.length); + + pst.src_addr = (phys_addr_t)rte_mem_virt2phy((void *) lsb_buf); + pst.dest_addr = (phys_addr_t)(cmd_q->sb_iv * CCP_SB_BYTES); + pst.len = CCP_SB_BYTES; + pst.dir = 1; + pst.bit_mod = CCP_PASSTHRU_BITWISE_NOOP; + pst.byte_swap = CCP_PASSTHRU_BYTESWAP_256BIT; + ccp_perform_passthru(&pst, cmd_q); + break; + case CCP_DES_MODE_CFB: + case CCP_DES_MODE_ECB: + CCP_LOG_ERR("Unsupported DES cipher mode"); + return -ENOTSUP; + } + + src_addr = rte_pktmbuf_mtophys_offset(op->sym->m_src, + op->sym->cipher.data.offset); + if (unlikely(op->sym->m_dst != NULL)) + dest_addr = + rte_pktmbuf_mtophys_offset(op->sym->m_dst, + op->sym->cipher.data.offset); + else + dest_addr = src_addr; + + key_addr = rte_mem_virt2phy(session->cipher.key_ccp); + + desc = &cmd_q->qbase_desc[cmd_q->qidx]; + + memset(desc, 0, Q_DESC_SIZE); + + /* prepare desc for des command */ + CCP_CMD_ENGINE(desc) = CCP_ENGINE_3DES; + + CCP_CMD_SOC(desc) = 0; + CCP_CMD_IOC(desc) = 0; + CCP_CMD_INIT(desc) = 1; + CCP_CMD_EOM(desc) = 1; + CCP_CMD_PROT(desc) = 0; + + function.raw = 0; + CCP_DES_ENCRYPT(&function) = session->cipher.dir; + CCP_DES_MODE(&function) = session->cipher.um.des_mode; + CCP_DES_TYPE(&function) = session->cipher.ut.des_type; + CCP_CMD_FUNCTION(desc) = function.raw; + + CCP_CMD_LEN(desc) = op->sym->cipher.data.length; + + CCP_CMD_SRC_LO(desc) = ((uint32_t)src_addr); + CCP_CMD_SRC_HI(desc) = high32_value(src_addr); + CCP_CMD_SRC_MEM(desc) = CCP_MEMTYPE_SYSTEM; + + CCP_CMD_DST_LO(desc) = ((uint32_t)dest_addr); + CCP_CMD_DST_HI(desc) = high32_value(dest_addr); + CCP_CMD_DST_MEM(desc) = CCP_MEMTYPE_SYSTEM; + + CCP_CMD_KEY_LO(desc) = ((uint32_t)key_addr); + CCP_CMD_KEY_HI(desc) = high32_value(key_addr); + CCP_CMD_KEY_MEM(desc) = CCP_MEMTYPE_SYSTEM; + + if (session->cipher.um.des_mode) + CCP_CMD_LSB_ID(desc) = cmd_q->sb_iv; + + cmd_q->qidx = (cmd_q->qidx + 1) % COMMANDS_PER_QUEUE; + + rte_wmb(); + + /* Write the new tail address back to the queue register */ + tail = (uint32_t)(cmd_q->qbase_phys_addr + cmd_q->qidx * Q_DESC_SIZE); + CCP_WRITE_REG(cmd_q->reg_base, CMD_Q_TAIL_LO_BASE, tail); + /* Turn the queue back on using our cached control register */ + CCP_WRITE_REG(cmd_q->reg_base, CMD_Q_CONTROL_BASE, + cmd_q->qcontrol | CMD_Q_RUN); + + op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; + return 0; +} + static inline int ccp_crypto_cipher(struct rte_crypto_op *op, struct ccp_queue *cmd_q, @@ -503,6 +629,10 @@ ccp_crypto_cipher(struct rte_crypto_op *op, result = ccp_perform_aes(op, cmd_q, b_info); b_info->desccnt += 1; break; + case CCP_CIPHER_ALGO_3DES_CBC: + result = ccp_perform_3des(op, cmd_q, b_info); + b_info->desccnt += 2; + break; default: CCP_LOG_ERR("Unsupported cipher algo %d", session->cipher.algo); diff --git a/drivers/crypto/ccp/ccp_crypto.h b/drivers/crypto/ccp/ccp_crypto.h index 614cd47..d528ec9 100644 --- a/drivers/crypto/ccp/ccp_crypto.h +++ b/drivers/crypto/ccp/ccp_crypto.h @@ -57,6 +57,9 @@ #define CCP_AES_ENCRYPT(p) ((p)->aes.encrypt) #define CCP_AES_MODE(p) ((p)->aes.mode) #define CCP_AES_TYPE(p) ((p)->aes.type) +#define CCP_DES_ENCRYPT(p) ((p)->des.encrypt) +#define CCP_DES_MODE(p) ((p)->des.mode) +#define CCP_DES_TYPE(p) ((p)->des.type) #define CCP_PT_BYTESWAP(p) ((p)->pt.byteswap) #define CCP_PT_BITWISE(p) ((p)->pt.bitwise) diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c index 5f56242..3a16be8 100644 --- a/drivers/crypto/ccp/ccp_pmd_ops.c +++ b/drivers/crypto/ccp/ccp_pmd_ops.c @@ -99,6 +99,26 @@ static const struct rte_cryptodev_capabilities ccp_pmd_capabilities[] = { }, } }, } }, + { /* 3DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size = 8, + .key_size = { + .min = 16, + .max = 24, + .increment = 8 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; -- 2.7.4