From patchwork Wed Jul 21 07:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483263 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941115jao; Wed, 21 Jul 2021 00:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvIzkfLfK4TWb89uZMtawfeG9QVi/T8XV6LrIN4ZUrQniltz+VjSSue3ceDRYl/hnq32WK X-Received: by 2002:a05:6000:144a:: with SMTP id v10mr40321377wrx.339.1626853346447; Wed, 21 Jul 2021 00:42:26 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id f11si29313085wrz.107.2021.07.21.00.42.26; Wed, 21 Jul 2021 00:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=eVixnkuE; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C4CF410E4; Wed, 21 Jul 2021 09:42:22 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20076.outbound.protection.outlook.com [40.107.2.76]) by mails.dpdk.org (Postfix) with ESMTP id 73FCD40F35 for ; Wed, 21 Jul 2021 09:42:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XkElLy1m6LbTKj2q4/0HdVAtckPgtksLZelrfRVGR/ocSBX5A4rjxuY9VvWHs49LoiL8E0zu7Wm4a5gSByujXIOm2dWpj0J5wy8+Vn+wLIZvL37mE2NDQ8GZOIltCczLwEPGuPDyNd7w4k/rNH85FbqjjW0Lq+XWdrHEeB7cvNJjYPpPExoLZOTPchwGFxeCbzWWEnRm5LEAXxHlRkEtQfDGfCMelm2hhwH4J646LXV7pwckGmrAOb0PSZDZsBsbFC3z+Ry002MIIf/YIGYgvOz+Phbqftt13PoVWYj0eOr2LRY6oRDcIFUdcKkq31opYWejGKhethtrSmablMrYrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rl6AZQZIz9YQG11+7z6+x54jCmQb2w06s2Ddfgq2Ukc=; b=AQ0kUp7JsefujU7d0U90hNsa5SlsNKoC+klTCNAjHtpEBY9rusBk49RZrPsVhzQrre5E23OR+D9O5B0wvqUHWhRB7CrlqymGoFPs9WeeH3GJZWqv7Y9AVo1UO4yKPhguj+ghKYBSCFS5wS8TmMfYoNGWG0Xpbx6R2H1N6Id4ML3hLHCPF716PNgdgYUQS8dqL1BoUcosdRNW0l4pZxE0rpam+2nejdZJwtZxCa7djGNdcX6z29e68yzqWhx+tbHqV4ZQTsNwzdHiXrIm9y9LWudZsJLgnVu8ixfPhgQDWpWnhEd/dex61bff9c1gUJkNEVEYFg0CWTZQjD+THbgx2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rl6AZQZIz9YQG11+7z6+x54jCmQb2w06s2Ddfgq2Ukc=; b=eVixnkuE1ngPejGiuP9JpKmlZZRFY+n28ZVgVPpePqW4X20LWzyj4ctrbK2/jpNUV4HkNe9zlQ20S9utNXxa5WiombqmMrXxxF3G8jJqUH8e1tFYMSBRW4g481boOiMzdg2iKuKab++zSNCOpy6wDsBdKzdd6MXKAqT751XYD00= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8581.eurprd04.prod.outlook.com (2603:10a6:10:2d8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Wed, 21 Jul 2021 07:42:18 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28%6]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 07:42:18 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, Gagandeep Singh Date: Wed, 21 Jul 2021 13:09:17 +0530 Message-Id: <20210721073920.21893-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210721073920.21893-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR06CA0240.apcprd06.prod.outlook.com (2603:1096:4:ac::24) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR06CA0240.apcprd06.prod.outlook.com (2603:1096:4:ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Wed, 21 Jul 2021 07:42:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d12611f-32e6-491f-fabc-08d94c1b1118 X-MS-TrafficTypeDiagnostic: DU2PR04MB8581: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SOK+LasAII06dKnhwz8Jabeb5BhnD0zH4b7/2b1rCB0ptqX0CM8HGTczCiF0putSZTlU/fKK/B2pm95PCa5HZeS2YZNiiG8rTnXd+68F1Bn9ReRRGSTKjok3tB4b5RrH8Q/X5CRAFd+/Mh5FQnYUiGatSY6hGJ9l8GILddCWQk2rQukioinlnMVGzAiGzHWHKuQ0bMfI4fz0Udayb/I+XtFRbTvMT+yfhvpAJQ1XJxpVQ2XgdQ+FewU7wrype/bKJzqdbBv/5UllbpmnugOB1xqOkowZanm7fxaURhbVT2tkf855Qgzn54KRClXe1CTkRfgcL0GXT19/eZk1UKSKdJNJDaYo7n5vgBvp51DWCx3344yREcG09isE92wTR37u7mtumn8S2Hb89K9GPAwEoly3QR86q+TIuSSgEha8gI2YFR4t58xuLzikhSucAer42zYA8vf1UoIiqpGhXz4/IVaxonppTo6JUN4RsylM7xjm5IYaETBAQmQiwj4NkvFQLadyhsCt7zY3scfYbgqdcfYWW4Nd2DrCD++vgIUWeQG/eo3/kKJjlpFGDNdn43Skq1YVqbshTygvstSa9mSdeaYSzP/Ruv1JKVC7uUpcbmr/F/1ro5uNkzJy894rqMbKmoze2gCQ4lEIpBiy4GyaioQ2Nyqm1oYMuTgb3xX7if+Vi/1yh24435XhQBmkbICw/xeus/rB4xK2Ipjui5A6Iw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(44832011)(6512007)(186003)(956004)(2616005)(66476007)(38100700002)(38350700002)(66946007)(1076003)(6506007)(5660300002)(8676002)(66556008)(36756003)(86362001)(26005)(83380400001)(2906002)(4326008)(8936002)(316002)(478600001)(6916009)(6486002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: viPC/XofuHmsKOEjzcE73lx2I/hYx3EvYdvuqn4ardkFEex9D+ApUs4/4DVbBJOlUDg26VteATakeMZXhB/VhfLxWYim9Ud3LGt6pGexdrHTkjcfiEgXZERwBvULJ0wLYKqdi9hSfigzzIttB6NgKC4RvDUwDsYdqKo73Cb0ICcQPk4dprOeU9TiHDNp7PUStZy7NorRHIbhET8MwMow/83JWorN44DJPyI21/+mdbd+GFJsaBlx0fdnXv3rysNU7IaHRa/RMibMXOGaltAV0JZw4usNFoNpJTIkkwoeh5dXYr4ZdOJqkxYbaxwRRR/vMrTdA08saLN5hbvod2AHp9RofmyVoYk/CrisHf02OcsOFzqaU60wlPA0lHmkC29+PpWzTWoKuK7GYdLREh41ysC+U7N5QiyFlsUCTqJG6AJLe5Cf0XoSegdE7vUrYF8vHvzEaA95UC4V1uHvXtakDswllEQFC4dxuF4gLO9adWOh0aRkPaBqAHpoc9H7CkyBJilNNZyZpvH2ltpF44JpchytZmN06DqkhUuBXbsVIs0yLjYzCdyOOzV6vl6Sn7tKZXPgO/DG+YNJlFdroDjBk66Ij5IVIfalSUwE3A/74k3GMR/+fBoumV0X+bjoW4FdyxUeELhmVh7L0hNZjHFAo3aeUnqsKM4l7DmezaevjF4mrMkE+EkWGnYUXlXztR8CslpqD3bcyZOaMwYfvRRFedHquN4CTNrKYfRSq5XUOJ/x1uC4YrjjXykndP5j/7KupvKlKCHmoatZoaTdKSvNk5BOB2qP63pznFZh/9fNoCLpP/c0Amq9le6XPWtUo8gUrEcpYzdQI6+KNyXB2Qtq81n4dWEi82Wd+ORkeeqsbovkbSxJh/PB3xOrjAxy2jzm7rkKNs4GUZ/IA2UezQb+O4vvBmzQchRlL3/hEB9z2Q67RtCgTFSLtpLK0IBPCRjsb7Vs00SmNbULRC25bxMJOGSnsfFsvxdIS0o9i8q7gcr6T+L/L/h5+L7QPHIeavi2qv/h7Xb2bAwIrBX+JUMHsW/tizfDnIrqXfLZw2JTUrfxiN5vVf3gsyFJrrkd8lZ+0VnqwcNEKMsF4drRiVnrWmcZCj8anJcrpJESN3jXdFL57d+Ykv003tPVk+6M/aN2PJ/vGB5F4s7Y08PyW5uG68Y/dvQUTXLG2gQDGKNPF4tGCruCQPIJ2lFCtNNgeBai+5UUQfZA5OCadeGIJ7x+ufnlFeV+qmPFqAhvAT78ODmN2rLBJGLLsVXTrLg+wB8OmPluo+kffQG6obLQgLyVpE85yeSgBw5THfsu+x61wz+TjNY50+T1cSkd0GhfkMm+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d12611f-32e6-491f-fabc-08d94c1b1118 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 07:42:18.6673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kCeC7mvLX8jlIu2cj+0+8ULBccCDWKJHHZ1a50a7MLHx7LPMfk5PyuNsaGMQxLNc79LpKvonkqZ59CEQa/9tSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8581 Subject: [dpdk-dev] [PATCH 2/5] crypto/dpaa_sec: support DES-CBC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gagandeep Singh add DES-CBC support and enable available cipher-only test cases. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 13 +++++++++++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 243f3e1d67..5d0d04d601 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -24,6 +24,7 @@ AES CBC (256) = Y AES CTR (128) = Y AES CTR (192) = Y AES CTR (256) = Y +DES CBC = Y 3DES CBC = Y SNOW3G UEA2 = Y ZUC EEA3 = Y diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 19d4684e24..af5c7c499c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -454,6 +454,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) switch (ses->cipher_alg) { case RTE_CRYPTO_CIPHER_AES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_AES_CTR: case RTE_CRYPTO_CIPHER_3DES_CTR: shared_desc_len = cnstr_shdsc_blkcipher( @@ -2043,6 +2044,10 @@ dpaa_sec_cipher_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2218,6 +2223,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2667,6 +2676,10 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, session->cipher_key.alg = OP_PCL_IPSEC_AES_CBC; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_PCL_IPSEC_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_PCL_IPSEC_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 368699678b..216e8c8b6f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -456,6 +456,26 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_DES_CBC, + .block_size = 8, + .key_size = { + .min = 8, + .max = 8, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, { /* 3DES CBC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = {