[dpdk-dev] [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Sun Jun 17 21:31:26 CEST 2018



> -----Original Message-----
> From: Verma, Shally [mailto:Shally.Verma at cavium.com]
> Sent: Sunday, June 17, 2018 4:01 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: Trahe, Fiona <fiona.trahe at intel.com>; akhil.goyal at nxp.com;
> dev at dpdk.org; Athreya, Narayana Prasad
> <NarayanaPrasad.Athreya at cavium.com>; Sahu, Sunila
> <Sunila.Sahu at cavium.com>; Gupta, Ashish <Ashish.Gupta at cavium.com>
> Subject: RE: [PATCH v3 4/6] test/crypto: add unit testcase for asym crypto
> 
> Hi Pablo
> 
> >-----Original Message-----
> >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch at intel.com]
> >Sent: 17 June 2018 18:23
> >To: Verma, Shally <Shally.Verma at cavium.com>
> >Cc: Trahe, Fiona <fiona.trahe at intel.com>; akhil.goyal at nxp.com;
> >dev at dpdk.org; Athreya, Narayana Prasad
> ><NarayanaPrasad.Athreya at cavium.com>; Sahu, Sunila
> ><Sunila.Sahu at cavium.com>; Gupta, Ashish <Ashish.Gupta at cavium.com>
> >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 at caviumnetworks.com]
> >> Sent: Wednesday, May 16, 2018 7:05 AM
> >> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> >> Cc: Trahe, Fiona <fiona.trahe at intel.com>; akhil.goyal at nxp.com;
> >> dev at dpdk.org; pathreya at caviumnetworks.com; Sunila Sahu
> >> <sunila.sahu at caviumnetworks.com>; Ashish Gupta
> >> <ashish.gupta at caviumnetworks.com>
> >> 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
> >verify the results, like what we do with symmetric crypto? Having known
> answers in the test vectors?
> >I am not familiar with asymmetric, that's why I am asking.
> >
> [Shally] I prefer to have it cross verified using an independent library module,
> 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 += -lm
> >> +LDLIBS += -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 asymmetric.
> >
> >>  ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
> >>  ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y)
> >>  LDLIBS += -lz
> >
> [Shally] You mean add another config option for Asymmetric test?

At least check for CRYPTODEV, but since this is enabled by default,
I think we need an RTE_CRYPTODEV_ASYM_TEST flag.

> 
> >..
> >
> 
> //snip
> 
> >> +#include <rte_crypto.h>
> >> +#include <rte_cryptodev.h>
> >> +#include <rte_cryptodev_pmd.h>
> >> +#include <openssl/ssl.h>
> >
> >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 = {
> >> +     .next = NULL,
> >> +     .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA,
> >> +     .rsa = {
> >> +             .n = {
> >> +             .data =
> >> +             (uint8_t *)
> >> +
> >
> >For better consistency, could you use the format used above (0x00, 0xB3,
> 0xA1...)?
> >
> >>       ("\x00\xb3\xa1\xaf\xb7\x13\x08\x00\x0a\x35\xdc\x2b\x20\x8d"
> [Shally] Ok.
> 
> >
> >...
> >
> >> +#pragma GCC diagnostic pop
> >> +
> >> +static int
> >> +test_rsa(struct rsa_test_data *t)
> >
> >...
> >
> >> +     rsa->n =
> >> +             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 =
> >     ^~
> >
> >My OpenSSL version is 1.1.0h.
> >
> [Shally] This library is tested with version 1.0.2m (mentioned above) and also
> one supported by openssl PMD . So, you need to take similar version.

I'd say we should support the latest stable version of OpenSSL.
Could you get the latest 1.1.0?

Thanks,
Pablo


More information about the dev mailing list