From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 51C2DA054F for ; Wed, 25 May 2022 12:08:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1BD340146; Wed, 25 May 2022 12:08:24 +0200 (CEST) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2050.outbound.protection.outlook.com [40.107.117.50]) by mails.dpdk.org (Postfix) with ESMTP id 5B6FF400EF for ; Wed, 25 May 2022 12:08:22 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PYnk6JZ4e3v+653OlrhVjnuSLEi1nBjO4mnsn82lHAm83ECBh5NpMvP1mTJKzyQ0ePMK/c23GFm71Cz9X9iFQbfKHwZjNnRaPtS41GaqzNVoHX0WJFDnZGCEv/dGY2c8ioh+KQVfFP7SB1pPTdSiCqGciFF3VloXTFQY+HhfiZova9G1FxIXnVkdFZmZ89KeKyECO73b79XpUa+DLPrwce0Ec0XvRXNadJrwMJF0gmsbJxDvNcPF+DRD3OZ/RTyseHadDz7y+1OUJRbBrbLyse+38d+vGZXhl3DgU2J/8baHV0heNHRNr2UtAYsdY8Mwx8cVKVsSz2e9yQBf3jZDvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yBMPGPd3HJ/BVqtVl2IbREaCsshmBMKkyU+GTQPyVTE=; b=QzeBKXDlB01mKkx+McJ7ess9AT2cyH6V1lTzelOzj/7RYVxEdp8Fp5BAvgaI05MQXKP/gbk/I59m8SUet6+mv+qKwxj+1rhKQ0C6r3JmfB93oLa4L4yIKfWsTbRoYu9t6Z5/Z76puo1gSmAD/fgMid2+Jgc8A8H5wYclwFADPmgqjFucXjnyByl8Cc6PtPQkHwD8Yf8A0hJcQtBlgKh1w1aLMY72DnLN27hcVPqSjJMSRvaOVoqM7+L0mDXcCInUm/IkCAEuLBKiV/r/r8T0JoRwEIQZ+NZSJKRRybu4U6bNy2i7SXMCz0sD6736YIXcf+W3wNXMDzvqQfrlu1oDAQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 54.79.123.149) smtp.rcpttodomain=intel.com smtp.mailfrom=tatacommunications.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=tatacommunications.com; dkim=pass (signature was verified) header.d=tatacommunications.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=tatacommunications.com] dkim=[1,1,header.d=tatacommunications.com] dmarc=[1,1,header.from=tatacommunications.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tatacommunications.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yBMPGPd3HJ/BVqtVl2IbREaCsshmBMKkyU+GTQPyVTE=; b=L4oxLpodH3OWOcyl3Bh/eYSCkFBDbCI4PD54mNcBoVn8RgP4savcVMk8GfvWRbUtxpKJR1D2og938wru1II/pdFKteT0sysG9Hnp2EmwAROG54PYrNCjZyM+st7EEu0JuYefbcDm1o+Nr2h/8Ly/YsZwYGkRI1OHvtoKmBeHnX6FQcCoE4PH3yXLvUJoW4m1Clo6kABWd0oZn44mH1oWZv4pgq/Ffj+dyI95RgTNlUiaHESK7Hygo/D2wWjyWFihOSB3nl5Y7KPmV3DE9/C6/3BhqR/hEmOFoaqREH+/dXGNNOxpOfIxYzZv3/BrFPDyWPBqnxHobQJNhYGWfaa/ww== Received: from SG2PR01CA0185.apcprd01.prod.exchangelabs.com (2603:1096:4:189::19) by SEYPR04MB5786.apcprd04.prod.outlook.com (2603:1096:101:86::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.23; Wed, 25 May 2022 10:08:19 +0000 Received: from SG2APC01FT0034.eop-APC01.prod.protection.outlook.com (2603:1096:4:189:cafe::73) by SG2PR01CA0185.outlook.office365.com (2603:1096:4:189::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 10:08:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 54.79.123.149) smtp.mailfrom=tatacommunications.com; dkim=pass (signature was verified) header.d=tatacommunications.com;dmarc=pass action=none header.from=tatacommunications.com; Received-SPF: Pass (protection.outlook.com: domain of tatacommunications.com designates 54.79.123.149 as permitted sender) receiver=protection.outlook.com; client-ip=54.79.123.149; helo=sydapipop-haraka-inline01.vpc-a3a96cc4.ase2.shn; pr=C Received: from sydapipop-haraka-inline01.vpc-a3a96cc4.ase2.shn (54.79.123.149) by SG2APC01FT0034.mail.protection.outlook.com (10.13.37.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 10:08:19 +0000 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01lp2043.outbound.protection.outlook.com [104.47.110.43]) by sydapipop-haraka-inline01.vpc-a3a96cc4.ase2.shn (Haraka/2.8.24) with ESMTPS id 50BD9638-FBC9-4A18-A3D6-A7D7D8B11F68.1 envelope-from (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Wed, 25 May 2022 10:08:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HB0zK2szdMPhdelOFuMuglF4qVYjKQbgt63878uSGrU/AhIL+YCom0XQ/B4nyi+pgYkZTRbB+HP6LYYEKRRDIqOkQ25Olafb7uqBFw6SHhch6UB9BH5E9XpzitHUbXtskkhWf+i+l3uFp/HlD6B34w/5CMuuk13hfLSC8B4kIhCsSJUFILtCMURfrDPUYi1QoLaYneXE5OzmWGC+TdsxNrgpLHoRspy1C5A0GmL/iQc2mm7jEvw4FXKYu4o87yVwNVpoPPa2NWiIZwaHO+1aMEIl6hlrZ5Kd/n5uwqQTs861IxipcsDfXHmK4jGISVrzOauDlCJ6QWuBxXoOZlxF5g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yBMPGPd3HJ/BVqtVl2IbREaCsshmBMKkyU+GTQPyVTE=; b=W3nk1a0GU/+/T5nT/nR6Cb3iv1DjoSnSUc2pxCNqLYq5uyXL1e0zS1FVc9JB79OaOwRHKNpX4FjfDyZQ+o9G4yTSwso4WeerxbKu2z6o4QNh12DnqDuUu2eBDhwjTScn8KUU3uTNZtyS+H1IAQJp+10g9RyEn2Cv7MbMO3bw2E/4yQp19woDw+Ottqpi6qn/5BL195U6gygZ5sWztHlyxsvkpyYdtBotrmYqZxwb2eE39eUWKpktlvROI+flXKld2nfDLe3127lnNR1PUTG8Qz0FGlmKEEUv89qKkahtvp4JXNceGL6Cil+dGJQ4vFOOY4XVQsAxwfb4LKbMi7rOKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=tatacommunications.com; dmarc=pass action=none header.from=tatacommunications.com; dkim=pass header.d=tatacommunications.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tatacommunications.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yBMPGPd3HJ/BVqtVl2IbREaCsshmBMKkyU+GTQPyVTE=; b=L4oxLpodH3OWOcyl3Bh/eYSCkFBDbCI4PD54mNcBoVn8RgP4savcVMk8GfvWRbUtxpKJR1D2og938wru1II/pdFKteT0sysG9Hnp2EmwAROG54PYrNCjZyM+st7EEu0JuYefbcDm1o+Nr2h/8Ly/YsZwYGkRI1OHvtoKmBeHnX6FQcCoE4PH3yXLvUJoW4m1Clo6kABWd0oZn44mH1oWZv4pgq/Ffj+dyI95RgTNlUiaHESK7Hygo/D2wWjyWFihOSB3nl5Y7KPmV3DE9/C6/3BhqR/hEmOFoaqREH+/dXGNNOxpOfIxYzZv3/BrFPDyWPBqnxHobQJNhYGWfaa/ww== Received: from PSAPR04MB5516.apcprd04.prod.outlook.com (2603:1096:301:5c::9) by TYAPR04MB2477.apcprd04.prod.outlook.com (2603:1096:404:18::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Wed, 25 May 2022 10:08:14 +0000 Received: from PSAPR04MB5516.apcprd04.prod.outlook.com ([fe80::2820:7577:ede8:f622]) by PSAPR04MB5516.apcprd04.prod.outlook.com ([fe80::2820:7577:ede8:f622%4]) with mapi id 15.20.5273.023; Wed, 25 May 2022 10:08:13 +0000 From: Balakrishnan K To: "Kusztal, ArkadiuszX" , "users@dpdk.org" Subject: RE: how to use crypto openssl PMD for asymmetric encryption and decryption Thread-Topic: how to use crypto openssl PMD for asymmetric encryption and decryption Thread-Index: Adhul7L76HpVKxCxQgm6OmL7h9++VgACBMowACMLKYAACHjIQAAGYdCQAC24WYA= Date: Wed, 25 May 2022 10:08:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_ActionId=1e9b2051-9f45-4073-b7f5-e6b509538b52; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_ContentBits=0; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_Enabled=true; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_Method=Privileged; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_Name=General-Test; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_SetDate=2022-05-23T11:32:59Z; MSIP_Label_5cbf6393-50e2-4904-bc3e-1804619f2b03_SiteId=20210462-2c5e-4ec8-b3e2-0be950f292ca; Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=tatacommunications.com; X-MS-Office365-Filtering-Correlation-Id: 27c37690-7371-419a-b6eb-08da3e367e72 x-ms-traffictypediagnostic: TYAPR04MB2477:EE_|SG2APC01FT0034:EE_|SEYPR04MB5786:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: aJGskLlrj4ThYydMruAVtGxeHJH7FkKW7cxiBxWRNX2r9JP94iH/f7U93Ml0DJmQQ/sZwfVDBJmyII38zTOiXOMByykpr1RkctQWZhKdnHjiQKR6DGij67IwrznWUx9G2pytYFav2334TiPhH7XvsdlvNck0dVjGH96sruSVhPQzKsZqH/G5RlkQL40CbaHNTeT7xuT02pTX2XlsygGEs9TCLhF8bHW7dJMy5YD2aNubjnc85el1oOVrpzgJhd9aom6WDjXS4A0rKe3Ssj3aZ/vFqFZPw7taeOdNHuwiw+YtiSXLtFrWng2ns12jRXTmwy55KetIGCMCWFZy5f0AC4LED+qcp7aJbQGw6+cCOzQsj0NmH0xJ+2Bm9RTV42rDgZHj5XrU71oKl7mMSJOeONZjF2zUXqD+MnRag4pbmqR3W+lO9CDf4/0N2I9/a4Ou/4K7kX7LrBiv4R4ijVt3EJlZdNc95/P2hqUXijKyGn1vHKjYMNoSc0KfiEGJmeiSWaV7E7obf59UsxyBgWb6FfCa/2DfvLO8t7MQUN1NsxFgSKJMi87cVtg103TkRusIZ53G5WWq/Vo/xIM5K6JxHo+g4bqG/d0uIdTAbDUGZJfzeezqAgMrD791c4n7tkj65/5nmG72zjgXOauu27V8pgK2rMj72IuAWwAd0Lz3sXPjU1HEFzc2qBMSv6leRo5TFmuOiGPh3lYQIThjSZPFrguzcYEw5T3/pno4U25lmEc3/bAm3DfJqbYhWCA8ha1U/kLPX7oq+bV4UCG6tAjdsjhzzHVzh+HbY4j/N3ntwLg= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PSAPR04MB5516.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(55016003)(316002)(966005)(33656002)(66446008)(8936002)(64756008)(66556008)(71200400001)(76116006)(26005)(9326002)(508600001)(5660300002)(52536014)(8676002)(66476007)(38100700002)(186003)(7696005)(6506007)(83380400001)(110136005)(38070700005)(9686003)(86362001)(53546011)(166002)(122000001)(2906002); DIR:OUT; SFP:1101; Content-Type: multipart/alternative; boundary="_000_PSAPR04MB551685FB5062627B5C852909D6D69PSAPR04MB5516apcp_" MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR04MB2477 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=tatacommunications.com; X-SHN-DLP-SCAN: success X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: SG2APC01FT0034.eop-APC01.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b52152f0-41b3-4c4d-e5ca-08da3e367ae5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GOVfhpa1PW8mdiPqrNFULnZyulpA0+erDvMLCJ06coFcTmF8mb9x0k56mC1AqrI5fEDsXMxf6O1f4PTAmQLe5bsdZzCZPzUKK8Wu5LOjTeY56Qj8r1lkAAVc5g4i0eBYDjY4gx5n+x0famw3yPr8iqfUvUAkGliYXPFVhmGtwtkqzdfv7XhvHJ8jANl/9bcQml/qQ+0bi2i/HbxAhjkEhuTYW9u7rwIGiMQWxlugq5XNzHlA4+8lfLSX+kVcxCQxzxQqDUC01PguFTbXToiZSaHOV7H0oxjySADXSqgURcBLuZYX0n5DkS2oQeyTTGgC1IUCUHJ1QC9/FlCQdwEpje1tQauLeMpEpTyZxHpCbUhRkilVsu1NFyrttK/SFYmBNIdy4CquM11uelQLvOw8x83DvzVZ31xzto+h7oaTuxJmJzWKaQ0Zj4MrP3p+ecmKxycOVsnQ6Mf9IH0fTaQjtrYO5ZXA78e9P6Hh4KLTLKcnoRGLunLf3oM8dU4UyjIwyBZlLuFIOCOJjZH7ft9lQpyYbj2MdgPB2dfDdMxDoijUvj22Xs86ybqO2Z69wjJmvgp5L7W1XCQ1b9Nfp1qwl5wYBpzIx/xDk9s9sSJfMtfkKuWLMR4e4JHggCtL6Pi4kxUqfp12ZfxkML/Lzrh2VoYKaE3NhAqxcCDjpBr5EJXFg9IOyvhG7ur2MgMUykC2S0/t4G0vFMO9uczVOy1bCmOxE7ffKrAC0+ff6w4xT9625i0jj14ybUciUBqXXifx0XcvSPoufVeaUWbi23qxDw== X-Forefront-Antispam-Report: CIP:54.79.123.149; CTRY:AU; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:sydapipop-haraka-inline01.vpc-a3a96cc4.ase2.shn; PTR:send1.mail-inline.syd-pop.i-shn.net; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(5660300002)(30864003)(9686003)(52536014)(8936002)(8676002)(966005)(166002)(356005)(81166007)(45080400002)(2906002)(83380400001)(40460700003)(26005)(110136005)(9326002)(36906005)(47076005)(316002)(508600001)(336012)(186003)(70586007)(53546011)(7696005)(6506007)(82310400005)(36860700001)(55016003)(86362001)(70206006)(33656002); DIR:OUT; SFP:1101; X-OriginatorOrg: tatacommunications.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 10:08:19.2418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27c37690-7371-419a-b6eb-08da3e367e72 X-MS-Exchange-CrossTenant-Id: 20210462-2c5e-4ec8-b3e2-0be950f292ca X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=20210462-2c5e-4ec8-b3e2-0be950f292ca; Ip=[54.79.123.149]; Helo=[sydapipop-haraka-inline01.vpc-a3a96cc4.ase2.shn] X-MS-Exchange-CrossTenant-AuthSource: SG2APC01FT0034.eop-APC01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB5786 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_PSAPR04MB551685FB5062627B5C852909D6D69PSAPR04MB5516apcp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Arek, I have public and private key with me which can be used for encryption/= decryption. To fill the below struct do I need to extract Publickey exponent , Private = key exponent etc. The reason why I am asking is, in openssl for encryption we will use key di= rectly with the exposed API. Example : RSA_private_encrypt(strlen(msg), (unsigned char *)msg, encrypted, rsa, RSA_= PKCS1_PADDING); Here in dpdk the rsa struct looks different . Thanks in advance. struct rte_crypto_rsa_xform { rte_crypto_param n; /**< n - Modulus * Modulus data of RSA operation in Octet-string network * byte order format. */ rte_crypto_param e; /**< e - Public key exponent * Public key exponent used for RSA public key operations in Octet- * string network byte order format. */ enum rte_crypto_rsa_priv_key_type key_type; __extension__ union { rte_crypto_param d; /**< d - Private key exponent * Private key exponent used for RSA * private key operations in * Octet-string network byte order format. */ struct rte_crypto_rsa_priv_key_qt qt; /**< qt - Private key in quintuple format */ }; }; Regards, Bala From: Balakrishnan K Sent: 24 May 2022 17:42 To: Kusztal, ArkadiuszX ; users@dpdk.org Subject: RE: how to use crypto openssl PMD for asymmetric encryption and de= cryption Hi Arek, Thanks for the detailed explanation. Regards, Bala From: Kusztal, ArkadiuszX > Sent: 24 May 2022 14:44 To: Balakrishnan K >; users@dpdk.org Subject: RE: how to use crypto openssl PMD for asymmetric encryption and de= cryption I should use debug_hexdump(stdout, "encrypted message", asym_op->rsa.cipher.data, asym_op->rsa.cipher.length); to check the encrypted message for the input given? Yes, currently it works this way. The same way output for decryption will b= e placed in asym_op->rsa.message.data and input in asym_op->rsa.cipher.data= . More explanations can be found in rte_crypto_asym.h file https://doc.dpdk.org/api/structrte__crypto__rsa__op__param.html. From: Balakrishnan K > Sent: Tuesday, May 24, 2022 7:24 AM To: Kusztal, ArkadiuszX >; users@dpdk.org Subject: RE: how to use crypto openssl PMD for asymmetric encryption and de= cryption Hi Arek, Thanks for quick response. I am using resulted output vector to verify the encrypted message. I thought the encrypted data will be in the asym_op->rsa.message.data after= rte_cryptodev_enqueue_burst and rte_cryptodev_enqueue_burst call with oper= ation type RTE_CRYPTO_ASYM_OP_ENCRYPT. So ,I checked the hex_dump of asym_op->rsa.message.data. Code snippet: asym_op =3D result_op->asym; debug_hexdump(stdout, "encrypted message", asym_op->rsa.message.data, asym_op->rsa.message.length); Encrypted data will be placed in asym_op->rsa.cipher.data after crypto oper= ation is my understanding is correct ? I should use debug_hexdump(stdout, "encrypted message", asym_op->rsa.cipher.data, asym_op->rsa.cipher.length); to check the encrypted message for the input given? Regards, Bala From: Kusztal, ArkadiuszX > Sent: 23 May 2022 18:15 To: Balakrishnan K >; users@dpdk.org Subject: RE: how to use crypto openssl PMD for asymmetric encryption and de= cryption CAUTION: This email originated from outside of the organization. Do not cli= ck links or open attachments unless you recognize the sender and know the c= ontent is safe. Hi Bala, Ciphertext will be written into asym_op->rsa.cipher.data (not message.data)= by the PMD, here you are using same address for both hex dumps. Although there is a bug in debug_hexdump in this function which may cause t= his confusion. Plus, the test you are referring is PWCT test (Pairwise conditional test) -= > it will encrypt, then decrypt. Please take a look into this comment in queue_ops_rsa_enc_dec function: /* Use the resulted output as decryption Input vector* So above this line there is an encryption part. Below is decryption. Regards, Arek From: Balakrishnan K > Sent: Monday, May 23, 2022 1:33 PM To: users@dpdk.org Subject: how to use crypto openssl PMD for asymmetric encryption and decryp= tion Hi All, I am new to dpdk. Planning to use openssl crypto PMD for encrypting/decr= ypting the packets. Couldn't find much documents on openssl PMD for asymmetric encryption/decry= ption. Any one please point me in the right document. I have tried to run the test cases wrote for asymmetric crypto using openss= l virtual PMD. But the output of particular test case is same after the encryption done. File : app/test/test_cryptodev_asym.c Test executable: ./app/test/dpdk-test Test case : test_rsa_enc_dec Input given to encryption: message at [0x1894e60], len=3D20 00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./...= . 00000010: 7E 78 A0 50 | ~x.P After processing the output also looks like same : encrypted message exist at [0x1894e60], len=3D20 00000000: F8 BA 1A 55 D0 2F 85 AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./...= . 00000010: 7E 78 A0 50 Regards, Bala --_000_PSAPR04MB551685FB5062627B5C852909D6D69PSAPR04MB5516apcp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Arek,<= o:p>

 &nb= sp;  I have public and private key with me which can be used for encry= ption/decryption.

&nbs= p;

To fill t= he below struct do I need to extract Publickey exponent , Private key expon= ent etc.

The reaso= n why I am asking is, in openssl for encryption we will use key directly wi= th the exposed API.

Example :=

&nbs= p;

RSA_private_encrypt(strlen(msg), (unsigned char *)msg, e= ncrypted, rsa, RSA_PKCS1_PADDING);

&nbs= p;

Here in d= pdk the rsa struct looks different .

&nbs= p;

Thanks in= advance.

&nbs= p;

struct rt= e_crypto_rsa_xform {

rte_crypt= o_param n;

 &nb= sp;      /**< n - Modulus

 &nb= sp;       * Modulus data of RSA operation in = Octet-string network

 &nb= sp;       * byte order format.

 &nb= sp;       */

&nbs= p;

 &nb= sp;      rte_crypto_param e;

 &nb= sp;      /**< e - Public key exponent

 &nb= sp;       * Public key exponent used for RSA = public key operations in Octet-

 &nb= sp;       * string network byte order format.=

 &nb= sp;       */

&nbs= p;

 &nb= sp;      enum rte_crypto_rsa_priv_key_type key_typ= e;

&nbs= p;

 &nb= sp;      __extension__

 &nb= sp;      union {

 &nb= sp;            =   rte_crypto_param d;

 &nb= sp;            =   /**< d - Private key exponent

 &nb= sp;            =    * Private key exponent used for RSA

 &nb= sp;            =    * private key operations in

 &nb= sp;            =    * Octet-string  network byte order format.

 &nb= sp;            =    */

&nbs= p;

 &nb= sp;            =   struct rte_crypto_rsa_priv_key_qt qt;

 &nb= sp;            =   /**< qt - Private key in quintuple format */

 &nb= sp;      };

};

&nbs= p;

&nbs= p;

Regards,<= o:p>

Bala

From: Balakrishnan K
Sent: 24 May 2022 17:42
To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; users@= dpdk.org
Subject: RE: how to use crypto openssl PMD for asymmetric encryption= and decryption

 

Hi Arek,

  Thanks for the detailed = explanation.

 

Regards,

Bala

&nbs= p;

From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 24 May 2022 14:44
To: Balakrishnan K <Balakrishnan.K1@tatacommunications.com>; users@dpdk.org
Subject: RE: how to use crypto openssl PMD for asymmetric encryption= and decryption

 

I should use 
debug_hexdump(stdout, "encrypted message&quo=
t;, asym_op->rsa.cipher.data,
        &=
nbsp;           &nbs=
p; asym_op->rsa.cipher.length);
to check the encrypted message for the input give=
n?

 

Yes, currently it works this wa= y. The same way output for decryption will be placed in asym_op->rsa.mes= sage.data and input in asym_op->rsa.cipher.data.

More explanations can be found = in rte_crypto_asym.h file

https://doc.dpdk.org/api/structrte__crypto__rsa__op__param.html.<= o:p>

 

From: Balakrishnan K <Balakrishnan.K1@tatacommunications.com>
Sent: Tuesday, May 24, 2022 7:24 AM
To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; users@dpdk.org
Subject: RE: how to use crypto openssl PMD for asymmetric encryption= and decryption

 

Hi Arek,

   Thanks for quick r= esponse.

I am using resulted output vect= or to verify the encrypted message.

I thought the encrypted data will be in the asym_op-&g=
t;rsa.message.data after rte_cryptodev_enqueue_burst and rte_cryptodev_enqu=
eue_burst call with operation type RTE_CRYPTO_ASYM_OP_ENCRYPT.
So ,I checked the hex_dump of asym_op->rsa.message.=
data.
 
Code snippet:
asym_op =3D result_op->asym;=
debug_hexdump(stdout, "encrypted message&quo=
t;, asym_op->rsa.message.data,
        &=
nbsp;           &nbs=
p; asym_op->rsa.message.length);
 
 
 
Enc=
rypted data will be placed in asym_op->rsa.c=
ipher.data after crypto operation is my understanding is correct ?
I should use 
debug_hexdump(stdout, "encrypted message&quo=
t;, asym_op->rsa.cipher.data,
        &=
nbsp;           &nbs=
p; asym_op->rsa.cipher.length);
to check the encrypted message for the input give=
n?
 
 
Regards,
Bala 
 

 

From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
Sent: 23 May 2022 18:15
To: Balakrishnan K <Balakrishnan.K1@tatacommunications.com>; users@dpdk.org
Subject: RE: how to use crypto openssl PMD for asymmetric encryption= and decryption

 

CAUTION: This email originated from outside of the organization. = Do not click links or open attachments unless you recognize the sender and know the content is safe. <= /p>

Hi Bala,

 

Ciphertext will be written into= asym_op->rsa.cipher.data (not message.data) by the PMD, here you are us= ing same address for both hex dumps.

Although there is a bug in debu= g_hexdump in this function which may cause this confusion.

 

Plus, the test you are referrin= g is PWCT test (Pairwise conditional test) -> it will encrypt, then decr= ypt.

Please take a look into this co= mment in queue_ops_rsa_enc_dec function:

/* Use the resulted output as d= ecryption Input vector*

So above this line there is an = encryption part.

Below is decryption.  = ;        

 

Regards,

Arek

 

From: Balakrishnan K <Balakrishnan.K1@tatacommunication= s.com>
Sent: Monday, May 23, 2022 1:33 PM
To:
us= ers@dpdk.org
Subject: how to use crypto openssl PMD for asymmetric encryption and= decryption

 

Hi All,

   I am new to dpdk. = Planning to use openssl crypto PMD for encrypting/decrypting  the pack= ets.

Couldn’t find much docume= nts on openssl PMD for asymmetric encryption/decryption.

Any one please point me in the = right document.

 

I have tried to run the test ca= ses wrote for asymmetric crypto using openssl virtual PMD.

But the output of particular te= st case is same after the encryption done.

 

File : app/test/test_cryptodev_= asym.c

Test executable: ./app/test/dpd= k-test

Test case : test_rsa_enc_dec

    <= /span>

Input given to encryption:&n= bsp;            &nbs= p;

message at [0x1894e60], len=3D2= 0

00000000: F8 BA 1A 55 D0 2F 85 = AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....

00000010: 7E 78 A0 50 &nbs= p;            &= nbsp;           &nbs= p;          | ~x.P<= /span>

 

After processing the output = also looks like same :

encrypted message exist at [0x1= 894e60], len=3D20

00000000: F8 BA 1A 55 D0 2F 85 = AE 96 7B B6 2F B6 CD A8 EB | ...U./...{./....

00000010: 7E 78 A0 50

 

 

Regards,

Bala

--_000_PSAPR04MB551685FB5062627B5C852909D6D69PSAPR04MB5516apcp_--