> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusz...@intel.com>
> Sent: Wednesday, July 17, 2019 3:12 PM
> To: Shally Verma <shal...@marvell.com>; dev@dpdk.org
> Cc: akhil.go...@nxp.com; Trahe, Fiona <fiona.tr...@intel.com>
> Subject: RE: [EXT] [PATCH v3 04/11] test: add cipher field to RSA test
> 
> 
> 
> > -----Original Message-----
> > From: Kusztal, ArkadiuszX
> > Sent: Wednesday, July 17, 2019 10:27 AM
> > To: 'Shally Verma' <shal...@marvell.com>; dev@dpdk.org
> > Cc: akhil.go...@nxp.com; Trahe, Fiona <fiona.tr...@intel.com>
> > Subject: RE: [EXT] [PATCH v3 04/11] test: add cipher field to RSA test
> >
> >
> >
> > > -----Original Message-----
> > > From: Shally Verma [mailto:shal...@marvell.com]
> > > Sent: Wednesday, July 17, 2019 9:42 AM
> > > To: Kusztal, ArkadiuszX <arkadiuszx.kusz...@intel.com>; dev@dpdk.org
> > > Cc: akhil.go...@nxp.com; Trahe, Fiona <fiona.tr...@intel.com>
> > > Subject: RE: [EXT] [PATCH v3 04/11] test: add cipher field to RSA
> > > test
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Arek Kusztal <arkadiuszx.kusz...@intel.com>
> > > > Sent: Wednesday, July 17, 2019 12:23 AM
> > > > To: dev@dpdk.org
> > > > Cc: akhil.go...@nxp.com; fiona.tr...@intel.com; Shally Verma
> > > > <shal...@marvell.com>; Arek Kusztal <arkadiuszx.kusz...@intel.com>
> > > > Subject: [EXT] [PATCH v3 04/11] test: add cipher field to RSA test
> > > >
> > > > External Email
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > -- This patch adds cipher field to RSA test cases
> > > >
> > > > Signed-off-by: Arek Kusztal <arkadiuszx.kusz...@intel.com>
> > > > ---
> > > >  app/test/test_cryptodev_asym.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/app/test/test_cryptodev_asym.c
> > > > b/app/test/test_cryptodev_asym.c index 4dee164..8391545 100644
> > > > --- a/app/test/test_cryptodev_asym.c
> > > > +++ b/app/test/test_cryptodev_asym.c
> > > > @@ -164,6 +164,7 @@ queue_ops_rsa_enc_dec(struct
> > > > rte_cryptodev_asym_session *sess)
> > > >         uint8_t dev_id = ts_params->valid_devs[0];
> > > >         struct rte_crypto_op *op, *result_op;
> > > >         struct rte_crypto_asym_op *asym_op;
> > > > +       uint8_t cipher_buf[TEST_DATA_SIZE] = {0};
> > > >         int ret, status = TEST_SUCCESS;
> > > >
> > > >         /* Set up crypto op data structure */ @@ -180,6 +181,8 @@
> > > > queue_ops_rsa_enc_dec(struct rte_cryptodev_asym_session *sess)
> > > >         asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_ENCRYPT;
> > > >
> > > >         asym_op->rsa.message.data = rsaplaintext.data;
> > > > +       asym_op->rsa.cipher.data = cipher_buf;
> > > > +       asym_op->rsa.cipher.length = 0;
> > > [Shally] I think this should be initialized to length of buffer
> > > available i.e. RSA Key size? PMD can override it with length of
> > > actual data written at output, which has to be less than , equal to
> RSA_key size.
> > [AK] - its because API comments are ambiguous in this case and we have
> > only one field describing array length.
> > I would suggest to rephrase cipher field API comments from "length in
> bytes
> >      * of this field needs to be greater or equal to the length of
> >      * corresponding RSA key in bytes"
> > To "underlying array should have allocated enough memory to hold
> > cipher output (bigger or equal to RSA key size". Then length could and
> > I think should be zero or unspecified at this point.
> > What do you think?
> 
> [AK2] Something like that:
>        * When RTE_CRYPTO_ASYM_OP_ENCRYPT op_type used underlying
> array
>        * should have been allocated with enough memory to hold cipher
>        * output (bigger or equal to RSA key size).
> The same for message field.
[Shally] This description is okay. But still I would assume app to set length 
field of cipher buffer to actual allocated than 0. But I look forward to more 
feedback on this from others

> > >
> > > >         asym_op->rsa.message.length = rsaplaintext.len;
> > > >         asym_op->rsa.pad = RTE_CRYPTO_RSA_PKCS1_V1_5_BT2;
> > > >
> > > > --
> > > > 2.1.0

Reply via email to