From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 97B961B219 for ; Wed, 10 Jan 2018 10:43:38 +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=dS39Al/XYIEADQocIwymbEWI+oubyWT6NBie8n6Lr+Gq+5a8wNWOEANp5JH9yNgkdOVqoZbS3x4j0I0/hyz4T/MfZKN3s0HDAf9s48lmQL6zAz2BsLMWyoNbl/3h9vg3hqpPrGHeZfqwBpIyJCiZ6Dlv6/2bJ6Da2/kH6O+fzYM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:43:36 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Wed, 10 Jan 2018 04:42:51 -0500 Message-Id: <1515577379-18453-11-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515577379-18453-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145198-97367-1-git-send-email-Ravi1.kumar@amd.com> <1515577379-18453-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: MAXPR0101CA0024.INDPRD01.PROD.OUTLOOK.COM (10.174.62.34) To CY4PR12MB1509.namprd12.prod.outlook.com (10.172.68.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c3b9d5c3-fefb-4999-0880-08d5580e9f99 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020049)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:F2BT5nRKRPgPOVyodb0sp7q/RprEUX8ltOl5mdNYT6NpyMSbX/HjbCPJht5urn2v/kuBWjL/4X1k7yuq+MhXHrWpwxRwPo/lzEstXUHOGRdZepY+nnJ8G1aEVLFLUQqXsAqDgWpxLvTdJnrqof8XS4hO0Cz0UQAZKB8jhLeHJIBDBdTw8VZZWT00PL0ChCJlzQtb1/8QX8Op/JGOBHF0t0fJWHh3p/Efn47Nk10nk3jcMp0cOAwYKsw5qsHT8mFf; 25:PK+QZIPpPT/2Q4JCelKUfwp++PBhSLymJFYr2mllH3Kl6TsVJUbI90gROM8w2Shsdxk7wGY0W5mIxj2lxT3pArkmnJ/1lMUqGc4mQztu/CW1DuDy73TbrLGABgXyXjwKlDLD0BfXmMDF58+icI919PLPd3uonklXkRBe3PgG9d6vnhu6CmkABOZgjo+1jVIIm9XqiSAxyq+dDCVOCS+frqRXfry6jffo0xukvMEWm6Ya31CPvVD9fu/DVcn+KTxLHeBVnqKnRRpF7tmuxRVs5f9Vmz/kgvKzh0EjeLfkCTdfIBTrniZmbliAQNEogmrF/Uhx9268tKcr1WBosZctOQ==; 31:+z45B0djG+UncHwz53uZX03jk0aCUhMjOwoDa7fpPYnONT/Sfd880gfAD/981NkYr2w/ek38vBBmGsRzPGRmt7d4Cce8NzE6X4B+67cdUuJkpGtB8AM5Jp5imkG5nNjvTCm8EYgCOupguxGAev/2KJygjoBlRhsaLbuO9zPvmFPirXc5/+MYcc22+2/RBjL/CkRwOkDmNshKUmpy7srvvKd4fCup/LAMuwy8qOCfIBM= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:pIDal9CLWjQU9abPBqgAVUxRM5DzjoAJ1x77BkxnxUtvfebXXBVjw9nl0bGKAO//7BxhXR9IRgvrg+ytjQ7VsV2Hpb/+uIJNatSOEBZ9cVqOWKpYXMS5+Ne7kHHLQqgiqF0BK8NOu8ttKERAs3w3QRwbM5IOobfNUmjua/MuIqTUviuOwWJTs082Rwx6KJbHtQN55N8Jx+7Ok45YbJiC7aBzYEqoIupRqLFsUJNPICkebkQn+7tay/Iv42GzRDUwnE2vttsCMIXxf7uG01C3tRpWVAWX+E9CmJb/ElQH8CbZodHcP8YwSIeMoZ8IIE4kBYzlmxwK/27YwsiZn5dDnSqy5ErLyvXsz2D9YJGH15GkowQeHoE6qdF6/90Hf/xnPJlH5MLYHy/gecF6emNoCOb9sIzGa+Qseyy+YcrlzFu1Tqlr9wIh/I1LqBRVKPTpBBE1QxQ7xS1RpQMMabK7pL86cDT2iQnkLTFQl9v+sr07JNkhWrZT9kiwbjX+YB5T; 4:UdglGebRvRP2F1B+OiP0G5eiNs4g1+aVFKAIWoM437wGWtgpW5uPxjcPNRekJSbFb8rooU2ePV7+cOYRUtrZYjMM2AlS2dzpe/hDQaODkmKglS89wnSrn0hgSjAcPFMHXp6MlzWTCBlOIG4Ut9E2MW/7pw24QE2qV8EjnshSBI6tC323VfcUbEZk27cUYzTQt2rpAy6e0/7MuWY0n0LtBeKl5IeD7aEIJixV5Nxl4IyZX6/557PYTAjqJ09QNWdgZzW7srSfcIJNxoT5tiFPqWtdqwwBETiP48/Mbik93HxcpFA7RMGa2IcgaRgj1iwP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501119)(6055026)(6041268)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(396003)(346002)(376002)(39380400002)(189003)(199004)(25786009)(8676002)(81166006)(47776003)(48376002)(6666003)(2950100002)(81156014)(6916009)(66066001)(50226002)(68736007)(36756003)(8936002)(16586007)(72206003)(50466002)(16526018)(316002)(53936002)(478600001)(5660300001)(86362001)(4326008)(386003)(2361001)(2351001)(6486002)(53416004)(97736004)(51416003)(76176011)(106356001)(105586002)(7736002)(6116002)(3846002)(2906002)(59450400001)(305945005)(7696005)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR12MB1509; 23:gZNuFhR1j1O8AqKFt6zPboweqy0l7rHG3wgfkKJFb?= =?us-ascii?Q?EjmZbMoPFVf5vLykXuWCuHdgScnwG3wjOQM8NjL0UBNTBXUTb0fWmYzQDJyG?= =?us-ascii?Q?lI2KvEFCLw76M7uzR/s/aesZdA+ic0tTY/IxNylqUG5uhg2N0fEotYXjz0Ju?= =?us-ascii?Q?PaQTy6IIUsl839S2lom5Dx/wU6ApAwK2wzWepE7eIIwv6qV5Xt0aCITclAsx?= =?us-ascii?Q?iExR8XfdUHQ2ZwXDh/epkcZ+yAw5kDKmjiRtp9B4i7amjm6inH1kcFr0bv1U?= =?us-ascii?Q?Gsp75bZlpL4fLk5U+zkkPjdBfW2XmYSKkxIAqmQt2cUkQglMNFUaHouTJo6m?= =?us-ascii?Q?mT83dQs8vGak76R67o9a3+YO4CP3Er3aKjB0WR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6h9KdIUU4qOYrMttrxE9MsblNqysdkOWlCMwyE5Ps0Y6mxWJvU8VDqz4dCRf8rJJZqKWc3TEI6ojQ/XBeGrZasKLfEy3X88BfQLEEHiAG4TsSUYb0g89Xd/wZ/kBO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:43:36.3967 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3b9d5c3-fefb-4999-0880-08d5580e9f99 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v3 11/19] 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: Wed, 10 Jan 2018 09:43:39 -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