[dpdk-dev] [PATCH] test/crypto: skip plain text compare for null cipher OOP

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Wed Nov 10 12:23:45 CET 2021


Hi Anoob,

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Anoob Joseph
> Sent: Monday, November 8, 2021 3:20 PM
> To: Akhil Goyal <gakhil at marvell.com>; Doherty, Declan
> <declan.doherty at intel.com>; Zhang, Roy Fan <roy.fan.zhang at intel.com>
> Cc: Anoob Joseph <anoobj at marvell.com>; Jerin Jacob <jerinj at marvell.com>;
> Archana Muniganti <marchana at marvell.com>; Tejasree Kondoj
> <ktejasree at marvell.com>; Hemant Agrawal <hemant.agrawal at nxp.com>;
> Nicolau, Radu <radu.nicolau at intel.com>; Power, Ciara
> <ciara.power at intel.com>; Gagandeep Singh <g.singh at nxp.com>;
> dev at 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 at 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


More information about the dev mailing list