DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Anoob Joseph <anoobj@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>,
	"Doherty, Declan" <declan.doherty@intel.com>,
	"Zhang, Roy Fan" <roy.fan.zhang@intel.com>
Cc: Jerin Jacob <jerinj@marvell.com>,
	Archana Muniganti <marchana@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>,
	"Hemant Agrawal" <hemant.agrawal@nxp.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>,
	"Power, Ciara" <ciara.power@intel.com>,
	Gagandeep Singh <g.singh@nxp.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher OOP
Date: Wed, 10 Nov 2021 11:23:45 +0000	[thread overview]
Message-ID: <DM8PR11MB55911A5C1637277ACF511ECC84939@DM8PR11MB5591.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1636384791-157-1-git-send-email-anoobj@marvell.com>

Hi Anoob,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Anoob Joseph
> Sent: Monday, November 8, 2021 3:20 PM
> To: Akhil Goyal <gakhil@marvell.com>; Doherty, Declan
> <declan.doherty@intel.com>; Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Cc: Anoob Joseph <anoobj@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> Archana Muniganti <marchana@marvell.com>; Tejasree Kondoj
> <ktejasree@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; Power, Ciara
> <ciara.power@intel.com>; Gagandeep Singh <g.singh@nxp.com>;
> dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher
> OOP
> 
> NULL cipher is used for validating auth only cases. With out of place processing,
> validating plain text should not be done as the PMD is only expected to update
> auth data.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
>  app/test/test_cryptodev.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index
> e54a1a9..964f44f 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -7490,6 +7490,22 @@ test_mixed_auth_cipher(const struct
> mixed_cipher_auth_test_data *tdata,
>  				tdata->digest_enc.len);
>  	}
> 
> +	/*
> +	 * NULL cipher is used for auth only cases where only authentication
> +	 * is done. With verify operation, MAC would be validated by the PMD.
> +	 * With generate operation, verify MAC generated by the PMD.
> +	 */
> +	if (op_mode == OUT_OF_PLACE &&
> +	    tdata->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {

Why only checking for OUT_OF_PLACE? As far as cipher algorithm is NULL,
only digest should be checked.
Also, looking at the code, there is this same check, but with hardcoded tag length.
Could you rearrange the code to have less lines and generic?

Something like:

<pseudo-code>
if (!verify)
	check_digest

if (cipher_algo != NULL)
	check_ciphertext/plaintext

check op status
</pseudo-code>

Also, I think this change is applicable in test_mixed_auth_cipher_sgl.

Thanks,
Pablo

  reply	other threads:[~2021-11-10 11:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 15:19 Anoob Joseph
2021-11-10 11:23 ` De Lara Guarch, Pablo [this message]
2021-11-10 11:48   ` Anoob Joseph
2021-11-10 13:04 ` [dpdk-dev] [PATCH v2] test/crypto: skip plain text compare for null cipher Anoob Joseph
2021-11-10 17:00   ` Power, Ciara
2021-11-10 17:16     ` De Lara Guarch, Pablo
2021-11-11 11:04       ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8PR11MB55911A5C1637277ACF511ECC84939@DM8PR11MB5591.namprd11.prod.outlook.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=anoobj@marvell.com \
    --cc=ciara.power@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=marchana@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).