From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0059.outbound.protection.outlook.com [104.47.41.59]) by dpdk.org (Postfix) with ESMTP id 085C7AAF1 for ; Mon, 19 Mar 2018 13:24: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=hMyK4zBPfvJb8qOK/SUBz6sBK6el4B1ayK842eLPOeY=; b=EYWfTdg6DC3+OSj0yP26WKhf3/a/YY9nt//xCeAJV3SLnQNtqTDOkaeooym4LppOaoKZCa/6KIXnzmOmNhgruu2Z5Ke+lBRSTKc5aTvhOuuKIvQvS2MRqThCF3YHFM8nP6GlI65WAGPrtf79aEZWnz78Gnjl0mDVPYBTlhElNF8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (10.172.24.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.14; Mon, 19 Mar 2018 12:24:36 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, hemant.agrawal@nxp.com Date: Mon, 19 Mar 2018 08:23:45 -0400 Message-Id: <1521462233-13590-11-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521462233-13590-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584520-130522-1-git-send-email-Ravi1.kumar@amd.com> <1521462233-13590-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: MAXPR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (10.174.62.139) To BN6PR12MB1505.namprd12.prod.outlook.com (10.172.24.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6edd77d3-70f1-4738-31d3-08d58d94618c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:QH59vxhJAoa5KB3QED7h1Bdo2UVq2+X6s8OXAsQPCNZNaaB0OZr/tQGbZGjKSStYkbZ5614kYgB3J1rlKbzZHWd+pwPzpPEs2dshh92HYZUdr4lzaB1a7Rcko8p+ifdo+OtxtqpyrC9v7OPUNxFwTHrbPeCqaZkgzIIy34yImfbybB5jcdZecbhFEv4wUyERwYUpVUEVqJmvP7JzCICzGNaGanSHiu3BGtRuglBBXpbApAlXZDYz9byRHKrfVI/d; 25:iUcvVeqQx7DjfTzWD7mKrR4vmVUN7s78U+bryAKD6EgK81KWUBqVCO6RP9Nk8mbYE74EhJW4mP5qyPCym4IVakTH58qswcuxSuHOaMRxLHfI/GMvnGZCKtAzCx/+kptRlObJEnr1TrFrBHIOolUvac7PRoZq4Fxs+4dJOQJuaZ0KNRg8VtPVsPrV9DMZQ5NzjSj0AzlO6Ue+57xjDQ3X/FoBpihayNpZ+H/7H/OlYibWcJzo+u3/GZRMs+j82XQqXo09sPMLMkkJdBCzFW2uBPNCUzE5GdArY6PAGVRcwuLj43Yvmiol1gIh6TCw9Oki0Gq6opiC7ScsV9LpD5cDCw==; 31:yLIujjZqepFN1NVxzrTmuGCwwqaZ5Bz3yEio900mWVSNY/OH19CX2XjI4fDCuSMAR1uYE5OBumjNRep1c3EEu46QhrLTG0qKz0V4a5Ks0IIS8JTD+WTPLGXPv8Ytv+0zjzRe1cG6i2U6JTD8rdFXHLo2VSf4n1VOoJ5VA9dqDU3ZblvfJA8ojKpeV8r7xeePn9QpNn1h8WEsmz12JT1y0mlkF+0fRANgIDS6gicBITM= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:blv9x3QVLkHXe1HMBzr6/j2QaBiuVzm62GZQgU3lWNo57vMvcVvDKiqcVakyVb/l5AusFNa2rMaZ8SfnTvB5t+TH/M/7HpXW2vgQcYUue37Ek6Innv+qDY5oh2flzONH5A4pm3W8H6ka2zGx0v40OpknNwA7zVoQ3tlYWM1+G3NxZYx2xzK4l3qYlerjizh+x3HndNWfQcal1yX7xIw68mSAVMofpAQ06ie6Td4Sgiz31tv4r+ZAteUzPhi8Hfgiig8rXoHEI1blnWfz0J+0BaFHI39qUwxTvaqgAgEk0i3rDNiC86i3zYXkRr/ZIz+PauawZ8Gr6wYYXebf9efVDAlvvsXIzr8ZssPQvDOVza+Z7k4h6r3wwoEjU4PFvb4Rfrw2oc7cA9VhAplLtV1rRc1ePfs5mMmsqVqzAUl7z6fBKC2PFlTIZRXyv8m2CKDQc/bF4w7ZxkUbUDApQQICHnW9YkjjuFMR9dLMuCQYXrx0DVmQMVMf50KY9rgOxS0F; 4:PFswNetErnQxKjndrUsDibSx5JrFya6CiL3GRijHBkUQ54eH2VxSDO8OmesTmir6aliHvs6R0EAmVX+90Ammj59L3lMdHZdd73T/ojfP3z1WAbyi+t3ZY+WUeq/QNQkqsT0j/mHHAAyhSBZP7DvwWAVVgRwLH/Wsq3+Qiyv/v5jnLGd5TCxhxHTwDkVCW2O7y4uaPKLuZYKbICQ+DS0rI0gtVCmxwt1Ngm+/gNLxDulUhH9ugcBMoCiK1L/h1TLzuPPBs5eKixEpk3MRRZdmx0823O6D1ZVtJ3zJ+KUFkFx33XFhgFLC0N04gWB3i5cZ 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)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06167FAD59 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(376002)(366004)(199004)(189003)(97736004)(105586002)(2361001)(2351001)(72206003)(48376002)(4326008)(50226002)(76176011)(59450400001)(8676002)(26005)(316002)(8936002)(53936002)(106356001)(16586007)(186003)(7696005)(51416003)(16526019)(52116002)(386003)(81166006)(81156014)(8656006)(25786009)(575784001)(66066001)(68736007)(86362001)(47776003)(6486002)(5660300001)(6666003)(7736002)(53416004)(6116002)(305945005)(3846002)(478600001)(2950100002)(36756003)(6916009)(2906002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1505; 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; BN6PR12MB1505; 23:7T88gW8UNqVQhOvawPcW2ZXRTUe4F5drHpTIuVJjU?= =?us-ascii?Q?OYZMOwucQGtQHhea8Qd/1Bl7rNoCvt/yRS3yvbd89IQk8+s6VVjcVZnxjt3Y?= =?us-ascii?Q?NgBTk4SShKgCxl+zs4eYjsPXGzkHHL5OQlqFD0mn4/z8L+dRhTARgBm0OUTr?= =?us-ascii?Q?Afhs6N3+mBYWItk6bNZHyQLyzu/mviHAnzr+I6YVftIRxQK2QwgvVw069wI9?= =?us-ascii?Q?nhyChooQCtiiMwMksb1+TMgO8tU3W932NfXArTbfR6i5zeQnhHcwRjz8blxd?= =?us-ascii?Q?UqrJNrhzqCJDcmCfCE2/EfeVodO82HPWoRyyiDHK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gnwQ8PLhtErfIoGfVpACHSADO6/67fqVdRGkU/HljSIIiU6RWtt6bng+j0rD/WuL+/Ic4lROBqaWHh16PtISq9UOZ94edR+byzpdtjbtQAXpDxWLWK0LE/FpOpXjNg4DekSlX46/uSkf1JL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:MYSbzHoOFU4gTNVXpp1kL2HkNJaSpaDadER5PLXaagqsVXq4Y1xKTYFKCNQmE9oIMUmKqtKFQQOYiFyvHTO3NQjp526u3P4xhQfaujdNcJ1MKbAhwkshSzzaxvu6dYSH00Np5lt7m8BlmZ+DBkKjD4F/bMSlsg/jedx0SB+lhTwUC8+dnjh0JTaoaEl9ljPsWAm1Tq0NG95e5fkSERW7ntaSGcoRvu4Bm/7RF0X5UT0UM0uESeNjAYEpGpMm3QzL X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2018 12:24:36.1246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6edd77d3-70f1-4738-31d3-08d58d94618c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v5 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: Mon, 19 Mar 2018 12:24: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 3c46ac3..a946f42 100644 --- a/drivers/crypto/ccp/ccp_crypto.c +++ b/drivers/crypto/ccp/ccp_crypto.c @@ -54,7 +54,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; @@ -89,6 +89,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; @@ -111,6 +116,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; @@ -254,6 +273,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); @@ -452,6 +475,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, @@ -477,6 +603,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 13cdb6e..3585c36 100644 --- a/drivers/crypto/ccp/ccp_crypto.h +++ b/drivers/crypto/ccp/ccp_crypto.h @@ -31,6 +31,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 a6e777a..a3b0d5c 100644 --- a/drivers/crypto/ccp/ccp_pmd_ops.c +++ b/drivers/crypto/ccp/ccp_pmd_ops.c @@ -73,6 +73,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