From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0051.outbound.protection.outlook.com [104.47.41.51]) by dpdk.org (Postfix) with ESMTP id 2012D1B433 for ; Sun, 17 Jun 2018 17:11:34 +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=jxL6nIISBIqRtQC6InGt4yD70QOcGfrcZlU9lA8LcEE=; b=HWLnYWBfGKctdKigm24Hrh84gyfGRSCx/GD9L0a2efZGM1bWaWeCYhrdk2EFqu2yrtisu3OoIZ9Qhw3AJ9EZd+ghsJsMOsZGfuFce+j9huYa1QTlpd0OR3623KZK5AyAlkkJ7sbWn2MeGq2hmfO0x6LDvlDMP5nHgoIfKRkmmB8= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3731.namprd07.prod.outlook.com (52.132.102.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Sun, 17 Jun 2018 15:01:06 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b%2]) with mapi id 15.20.0863.016; Sun, 17 Jun 2018 15:01:05 +0000 From: "Verma, Shally" To: "De Lara Guarch, Pablo" CC: "Trahe, Fiona" , "akhil.goyal@nxp.com" , "dev@dpdk.org" , "Athreya, Narayana Prasad" , "Sahu, Sunila" , "Gupta, Ashish" Thread-Topic: [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto Thread-Index: AQHUBjohrgdYj7jKoEOd9TIeonFbyaRkhh9Q Date: Sun, 17 Jun 2018 15:01:04 +0000 Message-ID: References: <1526450713-17299-1-git-send-email-shally.verma@caviumnetworks.com> <1526450713-17299-5-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: 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: [117.98.211.75] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3731; 7:oSUVXhUmQkZIBJuo4guv3kyUcS5uKTm3Agt2BlsIG+MiNIUxpXSbSkJ7KRhE5lV5zL8+OBPi0UhPsxoQ6qKxkcBBLSntCR7mCJ6stEv+LMypDr1a9gmuj4lX54wywIBySwLP/5QBBVDmlHiTsmZSsxllU0r4r0BwlOlsri/eRHJIEGDf68PNq9xpHRl0vWKppHuAPu4hJkjXPa+jhsS0m58Jpdw6Fo3Gi8JKx9uNkDyOkiFqJ9d8boFql8YyfESC x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(346002)(376002)(39380400002)(39850400004)(396003)(366004)(199004)(189003)(13464003)(99286004)(476003)(76176011)(55016002)(74316002)(102836004)(486006)(4326008)(316002)(54906003)(107886003)(6246003)(5660300001)(5250100002)(11346002)(186003)(6436002)(3660700001)(26005)(3280700002)(2900100001)(7696005)(59450400001)(53546011)(72206003)(6506007)(229853002)(478600001)(305945005)(8676002)(575784001)(25786009)(446003)(9686003)(68736007)(7736002)(66066001)(86362001)(105586002)(106356001)(8936002)(33656002)(81156014)(2906002)(97736004)(6916009)(81166006)(6116002)(3846002)(8656006)(14454004)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3731; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-office365-filtering-correlation-id: ea42ff28-87bb-4824-52a9-08d5d463263b x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3731; x-ms-traffictypediagnostic: CY4PR0701MB3731: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3731; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3731; x-forefront-prvs: 07063A0A30 received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cAfmSWvktNzKv19m8HA0zo/TNerFH2x4KpsuGkgX0oCTSaCj6Lfv6stYIuyqP+lrWFPqfi2wdX9hoaHCfiQebWhjxjk5BQX2HSm3fG2/+Z2oUIkgICohJIfJLPwBUwgZsqGuMRbrxqPoy+wLr5P2n5JSFjJlqW9dTlOhFzmjfnD69Zn5OmnlEk/n1rumxnCdI4TvNgz2wc+vDuwGBFhTBiVitk+QC0+X4R09YEZcOVxWrsG+3x5zZ4YRQaaNvVmT52l7M4K0Q4evEpxXqoG8ShSiEG8e1hEJ82lktMtGyYPhHr7aumOuwUuoD0Ww1kSDUAv7RKgJdbzApNs5u319rw== 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: ea42ff28-87bb-4824-52a9-08d5d463263b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2018 15:01:05.0284 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3731 Subject: Re: [dpdk-dev] [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto 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: Sun, 17 Jun 2018 15:11:34 -0000 Hi Pablo >-----Original Message----- >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com] >Sent: 17 June 2018 18:23 >To: Verma, Shally >Cc: Trahe, Fiona ; akhil.goyal@nxp.com; dev@dpdk.or= g; Athreya, Narayana Prasad >; Sahu, Sunila = ; Gupta, Ashish >Subject: RE: [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto > >External Email > >Hi Shally, > >> -----Original Message----- >> From: Shally Verma [mailto:shally.verma@caviumnetworks.com] >> Sent: Wednesday, May 16, 2018 7:05 AM >> To: De Lara Guarch, Pablo >> Cc: Trahe, Fiona ; akhil.goyal@nxp.com; >> dev@dpdk.org; pathreya@caviumnetworks.com; Sunila Sahu >> ; Ashish Gupta >> >> Subject: [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto >> >> Add unit test case to test openssl PMD asym crypto >> operations. Test case invoke asymmetric operation on DPDK >> Openssl PMD and cross-verify results via Openssl SW library. >> Tests have been verified with openssl 1.0.2m release. > >Is it possible to run these tests without using an external library to ver= ify the results, >like what we do with symmetric crypto? Having known answers in the test ve= ctors? >I am not familiar with asymmetric, that's why I am asking. > [Shally] I prefer to have it cross verified using an independent library mo= dule, that's the reason I kept design that way. >Also, you are adding asymmetric support for OpenSSL PMD in the 5th patch, >So this test won't work until then. >I think it is better to change the other between patch 4 and 5. [Shally] Ok > >> //snip >> >> -LDLIBS +=3D -lm >> +LDLIBS +=3D -lm -lcrypto > >If openssl libcrypto is actually required, I would add a check similar to >the one just below, with compressdev, to add "-lcrypto", so >users can run the test app without this, if they don't want to test asymme= tric. > >> ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) >> ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) >> LDLIBS +=3D -lz > [Shally] You mean add another config option for Asymmetric test? >.. > //snip >> +#include >> +#include >> +#include >> +#include > >Move this to the top of the file (as it is an external library to DPDK). > [Shally] Ok >> + >> +#include "test.h" >> +#include "test_cryptodev.h" > >... > >> +/** rsa xform using exponent key */ >> +struct rte_crypto_asym_xform rsa_xform =3D { >> + .next =3D NULL, >> + .xform_type =3D RTE_CRYPTO_ASYM_XFORM_RSA, >> + .rsa =3D { >> + .n =3D { >> + .data =3D >> + (uint8_t *) >> + > >For better consistency, could you use the format used above (0x00, 0xB3, 0= xA1...)? > >> ("\x00\xb3\xa1\xaf\xb7\x13\x08\x00\x0a\x35\xdc\x2b\x20\x8d" [Shally] Ok.=20 > >... > >> +#pragma GCC diagnostic pop >> + >> +static int >> +test_rsa(struct rsa_test_data *t) > >... > >> + rsa->n =3D >> + BN_bin2bn( >> + (const unsigned char *)rsa_xform.rsa.n.data, >> + rsa_xform.rsa.n.length, >> + rsa->n); > >I am getting a compilation error: > >/test/test/test_cryptodev_asym.c:322:5: error: >dereferencing pointer to incomplete type 'RSA {aka struct rsa_st}' > rsa->n =3D > ^~ > >My OpenSSL version is 1.1.0h. > [Shally] This library is tested with version 1.0.2m (mentioned above) and a= lso one supported by openssl PMD . So, you need to take similar version. Thanks for review. Shally >Thanks, >Pablo