From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5A1E91B534 for ; Sun, 17 Jun 2018 14:52:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2018 05:52:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,234,1526367600"; d="scan'208";a="58252842" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga002.fm.intel.com with ESMTP; 17 Jun 2018 05:52:56 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX151.ger.corp.intel.com (163.33.192.59) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 17 Jun 2018 13:52:55 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX156.ger.corp.intel.com ([169.254.3.252]) with mapi id 14.03.0319.002; Sun, 17 Jun 2018 13:52:55 +0100 From: "De Lara Guarch, Pablo" To: Shally Verma CC: "Trahe, Fiona" , "akhil.goyal@nxp.com" , "dev@dpdk.org" , "pathreya@caviumnetworks.com" , Sunila Sahu , Ashish Gupta Thread-Topic: [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto Thread-Index: AQHT7NwQZXgFaOIsBkSV4DQ2rgKI06RklDyA Date: Sun, 17 Jun 2018 12:52:54 +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: <1526450713-17299-5-git-send-email-shally.verma@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDUyZmNkNzgtNjI2Zi00MjQwLWE5MTUtZmE3ZjI2ZmJjOGYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibUI5SHdZRkNmbEIzNVpSbkN2dzQrbDNab2RjNU1QXC9KRTQxQ3ppREd3dEpWRG9IcE56SFhtSitJejhwdXg3WnUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 12:52:59 -0000 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 >=20 > 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 veri= fy the results, like what we do with symmetric crypto? Having known answers in the test vec= tors? I am not familiar with asymmetric, that's why I am asking. 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. >=20 > Tested for: >=20 > * RSA Encrypt, Decrypt, Sign and Verify using pre-defined > test vectors > * Modular Inversion and Exponentiation using pre-defined > test vectors > * Deiffie-Hellman Public key generation using pre-defined > private key and dynamically generated test vectors > * Deffie-hellman private key generation using dynamically > generated test vectors > * Deffie-hellman private and public key pair generation > using xform chain and using dynamically generated test > vectors > * Deffie-hellman shared secret compute using dynamically > generated test vectors > * DSA Sign and Verification >=20 > Deffie-hellman testcases use run-time generated test params, > thus may take some time for execution. >=20 > Changes from v2: > - Change test application to use the renamed APIs and > to use xform type from capability structure >=20 > Signed-off-by: Shally Verma > Signed-off-by: Sunila Sahu > Signed-off-by: Ashish Gupta >=20 > --- > This patch dependent on asym crypto API patches. > Please apply them before compilation > --- > --- > test/test/Makefile | 3 +- > test/test/meson.build | 1 + > test/test/test_cryptodev_asym.c | 1787 > +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 1790 insertions(+), 1 deletion(-) >=20 > diff --git a/test/test/Makefile b/test/test/Makefile > index d1a75fe92..9526b939d 100644 > --- a/test/test/Makefile > +++ b/test/test/Makefile > @@ -179,6 +179,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) +=3D > test_pmd_ring_perf.c >=20 > SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) +=3D test_cryptodev_blockcipher.c > SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) +=3D test_cryptodev.c > +SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) +=3D test_cryptodev_asym.c >=20 > ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) > SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) +=3D test_compressdev.c > @@ -205,7 +206,7 @@ CFLAGS +=3D $(WERROR_FLAGS) >=20 > CFLAGS +=3D -D_GNU_SOURCE >=20 > -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 asymmet= ric. > ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) > ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) > LDLIBS +=3D -lz .. > +++ b/test/test/test_cryptodev_asym.c > @@ -0,0 +1,1787 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2017-2018 Cavium Networks > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include Move this to the top of the file (as it is an external library to DPDK). > + > +#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, 0x= A1...)? > ("\x00\xb3\xa1\xaf\xb7\x13\x08\x00\x0a\x35\xdc\x2b\x20\x8d" ... > +#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. Thanks, Pablo