From patchwork Tue Sep 7 08:39:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507518 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4032962jai; Tue, 7 Sep 2021 01:44:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW4RP8HHYuBQQOa+1aUzBbUwhS56j4+HMYA9sr4EnzoxCJ1IuE51vwAU8Rlzd1p5b3G9I6 X-Received: by 2002:a17:906:2dd8:: with SMTP id h24mr17031384eji.204.1631004274314; Tue, 07 Sep 2021 01:44:34 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id y17si10616044edt.337.2021.09.07.01.44.34; Tue, 07 Sep 2021 01:44:34 -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=PTBxGonH; 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 C052F410EC; Tue, 7 Sep 2021 10:44:33 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40052.outbound.protection.outlook.com [40.107.4.52]) by mails.dpdk.org (Postfix) with ESMTP id 6841B410EB for ; Tue, 7 Sep 2021 10:44:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EM/AqtHPhqmTPdENVETBtIk1N12GLHzf7OCE6zAnHOsSSJkWy5SwC7hLdYENOA9TuBslqMBoS4lFOAnk1cSAjhUJvReIv9KttSmy9kYlZJIBxZgtctE3EL9OyA/JyaUGo8TFrFKVw3DOlYJVMe3ZZ15pPAJEfzIzQdFpKWcTr+nv0sOcu5RsuFt11bzVBkQm7jy8CLkcuqFz9L2XinpNWEJm3LqvzN+UPLa7T4UihJZf3UVo878vNo+IzJSiYY8R+XoD4hXhwUDfgLA3nHV9vOy9gYYz73RltATN3fP/8jiC35VjInSmk7cyb17hoT1rOS36xqdwjrJaKfdxy0VL+Q== 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; bh=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=A3MfOqyMyE6gTexTXIaL3CPFmXHs1juHgKTXv/aDjlGraj+bDp1w5cLINj4uSLlKvhNJwjkZ9w/8DHfuEQ7Q+ymH0JXjMLuFQMXtkvKjXeZzWtJHper8MEm4LQFGTqhcWF4sfW2ZYV/TE9ZgqiQ5W5hlfBKaedGmjZEk6tO+6neRT6iUKpiSctmFyURrLX0SJfo8Jwb9vDpoDnGMmJgRsebn/z/R4RaZ86IH+wFkEUUYfaVAo624GPgaxyWetPAzxlR1xWtkiCIB93nJxwbVfUwXohxkqiurhQVqCKi4+/hoWy/Gy9VmJjJ1S96zDzAX6HSw0IdO+lCieobYtLiCgg== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=PTBxGonHJlWtlkGkGTDaza8R6QA50og1UnKky7FWmOl5wCJIb+mjZmQ1nXREsIqmaF1d0LDevd7sdsgUKJleDSs4XGB+1FjULnrHXi47jGrlEvFkD8RAnylt9iAUfWwpDE2vzqXMwU8MALQ5+nNK1BCL2sOL32IaBaVwiUiPjbA= 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 DU2PR04MB8935.eurprd04.prod.outlook.com (2603:10a6:10:2e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:31 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:44:31 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:44 +0530 Message-Id: <20210907083953.8948-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) 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 SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0271ff3-295f-42e8-3041-08d971dbb5ee X-MS-TrafficTypeDiagnostic: DU2PR04MB8935: 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: Wn+wQl08/FRStFrANexuaw8H5Ql5Xjdler10Tgxj60ntCc3GuMJoi2Q8ktewpwC1VVvdIy/g8Gxhb3+yJZfWuZTx/Wems+YHYge18vuTnBmHz/3AEXOXlm6o8hXDgigWT5cQq+JtrUJQW30H6WGpgOhAsYa39lbxpRI3kAwSrCmYJGvb9KrtykXZ+64gVHS1xLAy3RtTKt+YquEwJVEn2pqrfSNfha/d4f96T2ww2DSyTm/7oAb7oM53IN9magH8yW6/Dr4huRkwiapKP1vJzWcG0gahSNJpFbZ2UoLZNBmAjfJx81QyRVUETZShh00aUYcPcb+SAO3vEE16qdLkDHP7IjW3suomTtObY+aCzpKKM56OETbSxhnwG0Qov5S2hNtRGQnsA6jEV2q3EkX8BTeJdYDpNEedDvRjimM9yguFwTnf+nZdz0dT+WigiCx5Iyb+jO+9+LO6rjW1mPJ8a5JIfPLGjTprditTUD0WKf8WkQcszxn7t2rsCM3cVPjdCngWGD4EHhgyix+NHKufqvm9oRvmv1k7zgIp2owdZf2fkSRVCVUcwksp1laJtiKun8ojqRDwiczApq2MY9vUQbyFPBhW9bCsdyBPYJ6YvwqjfVjiWfRfi5/MRtTn2zbSc8DfsvliSZn+7KAmLZSghLb51Ase+Rjgy3ePjgcW9ZTKOqaZqlcOJ7+H4215IiIh7fyOQVUHgZoqF3+6UOHCgA== 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)(136003)(39860400002)(366004)(376002)(396003)(2906002)(956004)(86362001)(2616005)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(36756003)(186003)(38350700002)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Amfi627omWMkYvWVL0hV4vjY2FwG5KdkHg9GiwLOVW2e2rNE/OMTyxa7NOm3d4wECOshjWR9Z0vfEcO0kwd3nze0p4WxuXO0oM1AHFgOHuHv7jtR4Btz0O8PBkIPt/owJhFQ6dmA9G1HXEfYbi19okicMTpQ5FVT9zqgudYWwaF8YT4EpRqIjRCMrQTs2eyB47wswjWqO5KysLOwWRKFYem+rzSk4Q/xFNL/hzAh+rRxUH2OSjoAv1jd1wv8TAy59h0yV5OZG3RF7hJjs4SmvksCEkpSj/iMgTKoGFNbM/qO3xKdJ4iNv3IIH8YIUr/t39Y5AeJ8cboEGGjkaayPoA7PdJBP8q+d/flT47muPjxGDzPOS3d8NyY1HCLyON1F8pXqWBrAVCw9h7rq6pgahPOrwAdjBQrBVm9Y2mPXlArmXUMOfD0ttvPcAi9pdwevXSYu7r3UwVCvxq3M5lXauPde0CqQWE4rukCcKf/bV+AcTnQ/GnkoPCpQuWYQLx2eP/G1vDGo5KxzQwoCTpEkfCwnN7dgXJtzB1okDCu5nN9nCTYZKwgDRti4/jXNUSomVZjOVjAY9qmstNFFdvCxWEQNigWdK5U0ccsmYHbVy5padJIm9sEh++FuwqXND8MG0bjzrqrEL/a+9qpoeNoabDzyiqrYLLt3cP1MES6agyGBAUvZOZFZgQmHnoV3TEU2mbWi0VIBpxvjJTsLL2ryiNnIXb3AAOn9gZ5ORq3b8oBcsZ3OvMzx6sy/x2XPW9ApeCBAGB2cGd7okEIldxuuGP6X7q40eF/mQgg3SOEsNRpVFYnsi/tva1rb3TpSCMFLcxwYRn/4IKAvv8C/AAN+13YftbAsw/9D1uqJafo0bNNQZr696gbY/OkTNj8a8cZuIlwxBKoPjA6Ds9uz+1klLg5+sPUxAinHY4OS5gOReAnmhjTTjDWS8syeBqTkdpgsqvO41Ut4FWs49kTfGtO0TjfOBT5KoxaxvlF22gUKcRr2meQtMrWrMMyIb/hJRQBJKRs4pIRdl9N/NG+zvQoU+TsUmSSWP1ZgOTP/agdZ99HC9ucFSo9Xq4Yp5ESMDLZYfCzNKcYgIlQpdZ4v88E22f/uQbll/ZR5Baz1I27eD44l876jc16AoV/hDfdMQ3zPTXNvGJaGL6T9mZ4WVDQh1NYrWITgP6kVoBJeqnMWh2L0weFpI15p9dMfrHO3WweNCIRgUTt/4f9FrF5JnttYHfXVoy+JKwT4qQJR/HvDaHbFsLGd8/R213OFpnFf3RIBJLVIDhw0dfc7TVFP4cKgseO0GRCQBZOF+8JQsMbPE1yWAYSJjHWKfpXlTYIy34le X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0271ff3-295f-42e8-3041-08d971dbb5ee X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:31.6705 (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: uzbsBOxCZ5CQyi945ZAiHl8T496ye5lvyndkXLQhbBOhuZSweEPoCevSvOXszF8MckORvLxQTvWKrcYPRcN0ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8935 Subject: [dpdk-dev] [PATCH v3 01/10] 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 7534f80195..0a58f4e917 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -451,6 +451,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( @@ -2040,6 +2041,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; @@ -2215,6 +2220,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; @@ -2664,6 +2673,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 2e0ab93ff0..9685010f3f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -482,6 +482,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 = {