From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0075.outbound.protection.outlook.com [104.47.34.75]) by dpdk.org (Postfix) with ESMTP id B1B4CF72 for ; Mon, 23 Jul 2018 18:55:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=igUxGsXgSBQ0FzJPuDoUP+h4QzgtFgAgnp5tRc9NVFY=; b=MT6ZxvRbsJGbMLtSUv4zTpr/rsgS/3bQEcG/jq2HDMEKQwtsEoSl511dHSVIdC4Zxd0cr4MHyimjZTDp9LJtZ6qCpV8DtDVs0/cfPbJuajvrF/WHjMbODnZWjc2+h/BpzChNp7NnXW2AwSqfWTiAprsHsfjUqFnpXt5JOcps9sk= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3729.namprd07.prod.outlook.com (52.132.102.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Mon, 23 Jul 2018 16:55:17 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f0d4:1828:37f5:5927]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f0d4:1828:37f5:5927%2]) with mapi id 15.20.0973.022; Mon, 23 Jul 2018 16:55:17 +0000 From: "Verma, Shally" To: Stephen Hemminger CC: "pablo.de.lara.guarch@intel.com" , "dev@dpdk.org" , "Athreya, Narayana Prasad" , "Murthy, Nidadavolu" , "Sahu, Sunila" , "Gupta, Ashish" Thread-Topic: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op Thread-Index: AQHUIpP9EHbsNWqzIUiN5Oima3rfbaSdBVuAgAAAXjA= Date: Mon, 23 Jul 2018 16:55:16 +0000 Message-ID: References: <1532357165-8575-1-git-send-email-shally.verma@caviumnetworks.com> <1532357165-8575-2-git-send-email-shally.verma@caviumnetworks.com> <20180723095027.40c7c1bf@xeon-e3> In-Reply-To: <20180723095027.40c7c1bf@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; x-originating-ip: [114.143.185.87] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3729; 6:JBTOQGisEH14u/ZZvRHfyY0Y8tzpLfSqGfqj8jJPfteGvdYIjWbN/T/TcZIpc1WrTj8DmPtH2ml7aPxVEULXayn6dOHssokFC9a3LUAU9+os0B/YzvHRveo3Ek8HcKhwBMX/OJbPyS226sXrmUDen7EuE3bdBbZpU/U1f+szcHDl2ojhyr9E0dCaQf6fCVuySke9vaKP0DthMMlf2wEMbasHWtUmDgHG34WDlYqRRAcg0e1J/jRZVF7SV4npQXQSoRXHw8pkE5JkT23wQEyHK0f0dqWAkZ9Zs2GpwSpGz61XV0zJiRifo13fkWSVRCzcr2kw3MOr0osMTuPf3yPEeKs/oyz6r2gkyfnVAZPEtguH5c5OTr/WCCrVQ+LUcWapZHQc1Gt3q7Xi9T2uuTqvcQV1IXJTnyxqO4dAFYaUH3lx1Q1hYB/S1xV3EJdJKG5cmHRy0Eu1v/dKXm9HQR7dxw==; 5:+UKYaSYB3AfptEzczxEL0a9DLIc/hx50w8KD6rTpGa7TPlx69ZJFczBfVSoEtvBfEDuvKY76Pp51T7Ry7+UFAvV+PXzXcAv76tsD2Gk77CzUv5NWYhZNsgE+E6WBR/eWqRfM+96B9WzCStnIIZ6Q773bKWrmfeCpHg/GgUAwU1Q=; 7:w18/vcKE2Qb6vTPWiVyykRhSicrXWMNlNu3ezfrkQQCJ9JhmK3Fh48zvcYUDSsYPKpwNqCZSGxkow0uw679E6SLGaNyym4sRwYU6lMvseNdREcwmJU5sIwj/FMyiJG90jW0M4qwC9IqqHvqdG7f3FmZ6p0wOndaPUAZgPMAUv9EYTyPXI0vka2t5p3/0QYL6GklOydQPifgj9IsYI+FeZ4WCgkYGYAgYYCqGVG30rCpng6qEQ2i1R5DySHwv5BiL x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(39860400002)(366004)(396003)(199004)(189003)(13464003)(7736002)(305945005)(6116002)(5250100002)(99286004)(8676002)(74316002)(54906003)(478600001)(81156014)(33656002)(81166006)(102836004)(186003)(86362001)(3846002)(26005)(97736004)(5660300001)(105586002)(76176011)(66066001)(316002)(6916009)(106356001)(6506007)(256004)(53936002)(446003)(476003)(6436002)(11346002)(8936002)(7696005)(55016002)(2906002)(25786009)(9686003)(14454004)(72206003)(107886003)(4326008)(229853002)(2900100001)(6246003)(486006)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3729; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-office365-filtering-correlation-id: 05348453-cb50-4903-1a29-08d5f0bd1127 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3729; x-ms-traffictypediagnostic: CY4PR0701MB3729: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3729; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3729; x-forefront-prvs: 0742443479 received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6f/9Iyz425jNVF67XPOlPAFMxnIy41FkbtVMZHkV+XCzS7la3c1ub/JOV/7O9inTcG0Nblg1jN6cEhRaWLfTkadGNXWsX2YadDPq3kizQ14jf4K06mwgd7QJ2/kwLDTghuwUkepoEQHAfL+Ng3N+QWZ4x8Xp2+r3BPMKb6w4bZF4TtG9Sp9RbeqWOWbBDEY8ZfppiirDOwbMWC9hZmupLfg1nKjyu0dZsY448DfWZqmnrp3PnsySQl0dBDkTPdxuxo+EwnDLKZNZPsIB7OpBOxnIHrHlq8LpbjgOaqn6LGRypWS+TZ5DS4F81W9SqCKNnxRsctyq+YsRixLhcVenO9RbxMhBQ3a5Em1I8VvSZXk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05348453-cb50-4903-1a29-08d5f0bd1127 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2018 16:55:16.6791 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3729 Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asym op 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, 23 Jul 2018 16:55:20 -0000 >-----Original Message----- >From: Stephen Hemminger >Sent: 23 July 2018 22:20 >To: Verma, Shally >Cc: pablo.de.lara.guarch@intel.com; dev@dpdk.org; Athreya, Narayana Prasad= ; Murthy, >Nidadavolu ; Sahu, Sunila ; Gupta, Ashish > >Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/openssl: add rsa and mod asy= m op > >External Email > >On Mon, 23 Jul 2018 20:16:03 +0530 >Shally Verma wrote: > >> +#define set_rsa_params(rsa, p, q, ret) \ >> + do {rsa->p =3D p; rsa->q =3D q; ret =3D 0; } while (0) >> + >> +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \ >> + do { \ >> + rsa->dmp1 =3D dmp1; \ >> + rsa->dmq1 =3D dmq1; \ >> + rsa->iqmp =3D iqmp; \ >> + ret =3D 0; \ >> + } while (0) >> + >> +#define set_rsa_keys(rsa, n, e, d, ret) \ >> + do { \ >> + rsa->n =3D n; rsa->e =3D e; rsa->d =3D d; ret =3D 0; \ >> + } while (0) >> + >> +#else >> + >> +#define set_rsa_params(rsa, p, q, ret) \ >> + (ret =3D !RSA_set0_factors(rsa, p, q)) >> + >> +#define set_rsa_crt_params(rsa, dmp1, dmq1, iqmp, ret) \ >> + (ret =3D !RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) >> + >> +/* n, e must be non-null, d can be NULL */ >> +#define set_rsa_keys(rsa, n, e, d, ret) \ >> + (ret =3D !RSA_set0_key(rsa, n, e, d)) >> + >> +#endif /* version < 10100000 */ >> + >> +#endif /* __RTA_COMPAT_H__ */ > >Please use inline functions instead of macros. >The crypto code seems to favor macros? > Since amount of code is very miniscule under each, so keeping as macro look= ed reasonable however, what goes in favour of inline than macros? Thanks for feedback. Shally >Macro's have no type checking and are not faster anyway.