DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Sivaramakrishnan, VenkatX" <venkatx.sivaramakrishnan@intel.com>
To: Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Power, Ciara" <ciara.power@intel.com>,
	"Kusztal, ArkadiuszX" <arkadiuszx.kusztal@intel.com>
Subject: RE: [EXT] [PATCH 2/2] test/crypto: add negative test cases for cipher buffer alignment
Date: Fri, 17 Nov 2023 09:38:51 +0000	[thread overview]
Message-ID: <DM6PR11MB3468D193E03C316C9710840D82B7A@DM6PR11MB3468.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO6PR18MB448437C4FEDD0DEF65CE73BDD8B3A@CO6PR18MB4484.namprd18.prod.outlook.com>

Hi Akhil,


> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Monday, November 13, 2023 12:31 PM
> To: Sivaramakrishnan, VenkatX <venkatx.sivaramakrishnan@intel.com>; Fan
> Zhang <fanzhang.oss@gmail.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [EXT] [PATCH 2/2] test/crypto: add negative test cases for cipher
> buffer alignment
> 
> > add negative test cases for 3DES CBC and AES CBC cipher algorithms for
> > buffer misalignment
> >
> > Signed-off-by: Sivaramakrishnan Venkat
> > <venkatx.sivaramakrishnan@intel.com>
> > ---
> >  app/test/test_cryptodev.c                  | 321 ++++++++++++++++++++-
> >  app/test/test_cryptodev_aes_test_vectors.h | 119 ++++++++
> >  app/test/test_cryptodev_blockcipher.c      |  20 +-
> >  app/test/test_cryptodev_blockcipher.h      |   1 +
> >  app/test/test_cryptodev_des_test_vectors.h |  38 +++
> >  5 files changed, 491 insertions(+), 8 deletions(-)
> >
> > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
> > index d2c4c6f8b5..12e0cf8044 100644
> > --- a/app/test/test_cryptodev.c
> > +++ b/app/test/test_cryptodev.c
> > @@ -1371,6 +1371,42 @@ negative_hmac_sha1_testsuite_setup(void)
> >  	return 0;
> >  }
> >
> > +static int
> > +negative_input_buffer_misalignment_testsuite_setup(void)
> > +{
> > +	struct crypto_testsuite_params *ts_params = &testsuite_params;
> > +	uint8_t dev_id = ts_params->valid_devs[0];
> > +	struct rte_cryptodev_info dev_info;
> > +	const enum rte_crypto_cipher_algorithm ciphers[] = {
> > +		RTE_CRYPTO_CIPHER_3DES_CBC,
> > +		RTE_CRYPTO_CIPHER_AES_CBC
> > +	};
> > +	const enum rte_crypto_auth_algorithm auths[] = {
> > +		RTE_CRYPTO_AUTH_SHA256,
> > +		RTE_CRYPTO_AUTH_SHA256,
> > +	};
> > +
> > +	rte_cryptodev_info_get(dev_id, &dev_info);
> > +
> > +	if (!(dev_info.feature_flags &
> > RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) ||
> > +			((global_api_test_type ==
> CRYPTODEV_RAW_API_TEST)
> > &&
> > +			!(dev_info.feature_flags &
> > RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
> > +		RTE_LOG(INFO, USER1, "Feature flag requirements for
> Negative
> > "
> > +				"Input Buffer misalignment testsuite not
> > met\n");
> > +		return TEST_SKIPPED;
> > +	}
> > +
> > +	if (check_cipher_capabilities_supported(ciphers, RTE_DIM(ciphers))
> != 0
> > +			&& check_auth_capabilities_supported(auths,
> > +			RTE_DIM(auths)) != 0) {
> > +		RTE_LOG(INFO, USER1, "Capability requirements for Negative
> "
> > +				"Input Buffer misalignment testsuite not
> > met\n");
> > +		return TEST_SKIPPED;
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> >  static int
> >  dev_configure_and_start(uint64_t ff_disable)  { @@ -14469,6
> > +14505,192 @@ aes128cbc_hmac_sha1_test_vector = {
> >  	}
> >  };
> >
> > +static const struct test_crypto_vector
> > +aes128cbc_sha256_misalign_test_vector = {
> > +	.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,
> > +	.cipher_offset = 0,
> > +	.cipher_len = 511,
> > +	.cipher_key = {
> > +		.data = {
> > +			0xE4, 0x23, 0x33, 0x8A, 0x35, 0x64, 0x61, 0xE2,
> > +			0x49, 0x03, 0xDD, 0xC6, 0xB8, 0xCA, 0x55, 0x7A
> > +		},
> > +		.len = 16
> > +	},
> > +	.iv = {
> > +		.data = {
> > +			0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> > +			0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
> > +		},
> > +		.len = 16
> > +	},
> > +	.plaintext = {
> > +		.data = plaintext_aes_common,
> > +		.len = 511
> > +	},
> > +	.ciphertext = {
> > +		.data = ciphertext512_aes128cbc,
> > +		.len = 511
> > +	},
> > +	.auth_algo = RTE_CRYPTO_AUTH_SHA256,
> > +	.auth_offset = 0,
> > +	.auth_key = {
> > +		.data = {
> > +			0x42, 0x1A, 0x7D, 0x3D, 0xF5, 0x82, 0x80, 0xF1,
> > +			0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,
> > +			0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,
> > +			0x9A, 0x4F, 0x88, 0x1B, 0xB6, 0x8F, 0xD8, 0x60
> > +		},
> > +		.len = 32
> > +	},
> > +	.digest = {
> > +		.data = {
> > +			0xA8, 0xBC, 0xDB, 0x99, 0xAA, 0x45, 0x91, 0xA3,
> > +			0x2D, 0x75, 0x41, 0x92, 0x28, 0x01, 0x87, 0x5D,
> > +			0x45, 0xED, 0x49, 0x05, 0xD3, 0xAE, 0x32, 0x57,
> > +			0xB7, 0x79, 0x65, 0xFC, 0xFA, 0x6C, 0xFA, 0xDF
> > +		},
> > +		.len = 32
> > +	}
> > +};
> 
> Why are the vectors added in .c file?
> 
We will move the tests to blockcipher test vectors and put in test vector header files with others.
> 

<snip>
> > +
> >  static const struct test_crypto_vector
> > aes128cbc_hmac_sha1_aad_test_vector = {
> >  	.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC, @@ -15058,7
> +15280,7 @@
> > test_authenticated_decryption_fail_when_corruption(
> >  }
> >
> >  static int
> > -test_authenticated_encrypt_with_esn(
> > +test_authenticated_encrypt(
> 
> Any specific reason of changing the name of this function in this patch.
>  


Renamed so that we could reuse with these tests and not just the ESN tests.
For the next version, as tests are moved to blockcipher test functions, this change is no longer needed.

> 
> >  		struct crypto_testsuite_params *ts_params,
> >  		struct crypto_unittest_params *ut_params,
> >  		const struct test_crypto_vector *reference) @@ -15159,7
> +15381,7 @@

<snip>

more work is needed on the tests so will drop this patch for 23.11.
Will send a new version of QAT patch Today.

Thanks,
Venkat.

  reply	other threads:[~2023-11-17  9:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 13:30 [PATCH 1/2] crypto/qat: fix block cipher misalignment for AES CBC and 3DES CBC Sivaramakrishnan Venkat
2023-11-03 13:30 ` [PATCH 2/2] test/crypto: add negative test cases for cipher buffer alignment Sivaramakrishnan Venkat
2023-11-06 23:25   ` Ji, Kai
2023-11-13  7:00   ` [EXT] " Akhil Goyal
2023-11-17  9:38     ` Sivaramakrishnan, VenkatX [this message]
2023-11-06 23:24 ` [PATCH 1/2] crypto/qat: fix block cipher misalignment for AES CBC and 3DES CBC Ji, Kai
2023-11-17 12:37 ` [PATCH v2] " Sivaramakrishnan Venkat
2023-11-17 14:43   ` Power, Ciara
2023-11-22 16:23     ` Thomas Monjalon

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=DM6PR11MB3468D193E03C316C9710840D82B7A@DM6PR11MB3468.namprd11.prod.outlook.com \
    --to=venkatx.sivaramakrishnan@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=stable@dpdk.org \
    /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).