From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0083.outbound.protection.outlook.com [104.47.34.83]) by dpdk.org (Postfix) with ESMTP id A4A58AAB5 for ; Fri, 9 Mar 2018 09:35:58 +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=ibq1oGcTzP5Vo9O+xXnXD7K5Qfoh/NsKmci2mE5hP+COd6uHvMtqFGnhA/76SSNOs8tYQvXyk47GTxgiILvb+a3BALfAtrCRJFYV0UPFNTNO9AUPab74DQHi5h9hqQFwN30z2j8bJbCDUeDN7f47DVrUksPYPDlz/Pdt3gnxGlI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.14; Fri, 9 Mar 2018 08:35:56 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Fri, 9 Mar 2018 03:35:11 -0500 Message-Id: <1520584520-130522-11-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> References: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> <1520584520-130522-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: MA1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::12) To MWHPR12MB1518.namprd12.prod.outlook.com (2603:10b6:301:b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 177dbd4d-64b9-4632-d8ae-08d58598c770 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1518; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 3:TAitEieIWtcLvu7JAWsJF8LOKMzg4uHZAA+NyYSMBWTsASOVksEeDJUhTda6lOFSrKdzTBeUgKW3fxyCfwZMcESlIXzYG8UkgJ7/e+HorhMoCEEKwqtvQ/d8V4yslpL7PIeVu17HYD1MN37NJDEZ35lVQTK0FOzJsMX1LBg/RMc1zZlLfOFvy2SxBpAoZolg01mwjYU6uJEQYpu1bN2MURGhF/Gv8+wcOv+Pus/s/tpXU/v/rGIRIK+sKmrTJZIa; 25:UL0IZeKgU3mSnFAUnVzv1pM7Xl0qu+oIvR2lHPT+cwNKOdtUkPI7Mx+T8UQx8lAvexh4cH/ZOeI3D+NBfzbvsFHVhXDVRqNuznOUrrS6NPi1akLTxqbcYpfWLYVLW5LFyNBwK40KWC41dJuaBrw7g9dJb1uWo4pHiXtE96+lx1l1T3POxa5ycJrggapHbJP5c1SqqUskWMt7kqrbQLqRV/+rN/DRySKbnTbmHjqrxYDxTz3Wz1yz+bvZIMPdUAHWtumvC0UcAUq9yVua6DhlzV+uXxJQvXyu1s02YhPAC7T6bz4J1YDJ9s0LkrLvESHKm48BB7ZJtULzJ+CnGNy2BA==; 31:+zWUEnejYKElWjBSWX475ENDE9uiTs9mQkhdyLNUFSJ/Z6oWZzOBdg8rtBypYTJ9PQptP+fj0BtGC0oW6Vba/RQdXPlRo8g/1iRux5kfJWJh/pqBYjWhGkS7oVqTlyB1oz425KI0pfBe7Z9Ol3iSdkhHfbtPh3DWfpQ14mQVzy+DNM7+kuoDhuWhZdYszcJimFamJzs/1StMdqgiJvJ77u4UgcPK2xX4gv0pWqRhpVk= X-MS-TrafficTypeDiagnostic: MWHPR12MB1518: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:ZYZKzDfb8MiakdHy4zTBC7j+rbbxwybpakUbkR3y5hHlQHs3llCTMRsaJuUFsSYlyJtKOVlIf6WraKS2ILs5D55jf7Gmu47jvm6uTapus+UZpc/Y5ndtftl5eUV3hfjp3UDxLPbHpT1s8mtO5NCBFarAyW3RL0N/LzJy+qvIGcyuZkUcrqqyjrYBAumIenTYz5IGROV+nQgQ92aJ+NdbIzUjpyjg0CrSqloTUTrzTHDwmH5vtHqJm5QUMiG28YPm32aFKOr/3pIVFJuskj61umyjJ34Xq1qpXXJC2EH2LDckdHY+4vxgDvUmgH8qIjnac1DAo0NUyyDr8fZ45sAforMsyo8O+x16AXCX9R87DA+l/BZEo9J20ov5gR09elt3OvS6JvJbNTC/kCKz/k0CenD68Q3Nl4jd2i3wCdBcQTSegJFVJCb7/EiHVBmq2Gs2QVhIkivCrPDT9gpCBQ4kcTJjllf4hfkYpsWvNw21lV2wcZjNMwvFhf56sxjttQ4Y; 4:zWsMnH3ctRcon3+e/U14pzuYTgUQ+0nNY+GvGFSW9jcAoUq7ZgSrOyKywn/xyzFB3KcsnrBcjN+03QAW+MSWPsfCtQK+R0FdPKlf1wnVQrGchLvfsoUcOnFbuw5UTsjjTVFwYkad5+mNxGzu7OljGbAOoVqCxqoy3CLNzH21sjuGLLCM2i5JrDeZB+Ygviy2TKczKqWomsNbYik/4K6Y04fZuwp+iUPKBqasiilTQ0YWehzjQPSd5D30cLYFpR70ANkJwAuuQrWNTmmKGZp1eZ9eKR2WC0hcOdsvRWkBT7iNCIOkFmqZO36Tp1Xo6wGI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501244)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR12MB1518; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1518; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(366004)(376002)(346002)(199004)(189003)(16586007)(26005)(81156014)(16526019)(8676002)(186003)(81166006)(25786009)(7736002)(3846002)(386003)(305945005)(4326008)(6116002)(6666003)(316002)(86362001)(76176011)(52116002)(8936002)(51416003)(50226002)(5660300001)(2906002)(2950100002)(6916009)(59450400001)(7696005)(36756003)(106356001)(105586002)(6486002)(68736007)(48376002)(97736004)(53416004)(2361001)(2351001)(53936002)(50466002)(478600001)(47776003)(66066001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1518; 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; MWHPR12MB1518; 23:6KGGzWHimfxOCSf4RhcIOTZB25iim5a0NdabhVGX4?= =?us-ascii?Q?mtkAplOc3rUVXzHqXOna73zNihOQXplz4l9vLCGmGTTovrnKskSGCSdhcy1P?= =?us-ascii?Q?fPeVYQcknBiVFbIkka/cJJw9XEW7bH+zffkjvdJYD4WFIXzNf0g7oDEUk2R9?= =?us-ascii?Q?SHowbEJ2QICYczVssX+JsKucn71+xHNW9gMX0OwJoU8u7NbJwjyc6k5Qarrc?= =?us-ascii?Q?WK+s+yYMNMXm89D/ZWPfvPf/evm4U2+qjzREoz+cEyXBi3nruN2V4FjieaqK?= =?us-ascii?Q?x5cc93BcS2SisthcR4PWqYrZ57tgbbjVg2t5fX6GOCYVpaz2Svw3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X2SAfAoK49ZQ/mJoairkq4p+phXx3TLMPt298JwoGt6215RPsq0rpreBQ8cye6XAK2GyoZJrqlRW9PCgRzzx/P9o9Io5m1BOnG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1518; 20:qFOOjIMWf8A8vb7jefgJhVxSxAuy87DvCRBwYOfFd4Z9ru5wHc3cUO1zBZ0zu08wiT17QG/x3QyDboyLbsksQaQZQFQ/FayYXNBglcJnqCIwycUkeGgWDLDGFHoWG3TCyv5qnajFsE2+t9JmGyXgqA3bkHW13zIjMvLzMt+MQjCMghe2STzdc5Q9IXNvkFw8MkOnuSQr13D+53xzh20oMXQd+WOOthrXg2eplt5Wv9zdJlsTgNTMIiASMrlj7CS0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:35:56.1940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 177dbd4d-64b9-4632-d8ae-08d58598c770 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1518 Subject: [dpdk-dev] [PATCH v4 11/20] crypto/ccp: support 3des cipher algo 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, 09 Mar 2018 08:35:59 -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