DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Kusztal, ArkadiuszX" <arkadiuszx.kusztal@intel.com>
To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "anoobj@marvell.com" <anoobj@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>,
	Fan Zhang <fanzhang.oss@gmail.com>, "Ji, Kai" <kai.ji@intel.com>
Subject: RE: [v1 5/6] app/test: check asymmetric capabilities in SM2 test
Date: Tue, 26 Sep 2023 20:05:31 +0000	[thread overview]
Message-ID: <PH0PR11MB501303497E8CFB4FC3325AE19FC3A@PH0PR11MB5013.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f3be0a425170ee26a1396d34f52a8e07941f7ce5.1691658879.git.gmuthukrishn@marvell.com>



> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Thursday, August 10, 2023 11:35 AM
> To: dev@dpdk.org
> Cc: anoobj@marvell.com; Akhil Goyal <gakhil@marvell.com>; Fan Zhang
> <fanzhang.oss@gmail.com>; Ji, Kai <kai.ji@intel.com>; Gowrishankar
> Muthukrishnan <gmuthukrishn@marvell.com>
> Subject: [v1 5/6] app/test: check asymmetric capabilities in SM2 test
> 
> Check asymmetric capabilities such as SM3 hash support and internal RNG and
> accordingly choose op params for SM2 test.
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
>  app/test/test_cryptodev_asym.c             | 127 ++++++++++++++-------
>  app/test/test_cryptodev_sm2_test_vectors.h |  28 +++--
>  2 files changed, 103 insertions(+), 52 deletions(-)
> 
> diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
> index b08772a9bf..1f39b1f017 100644
> --- a/app/test/test_cryptodev_asym.c
> +++ b/app/test/test_cryptodev_asym.c
> @@ -608,6 +608,7 @@ static inline void print_asym_capa(
>  	break;
>  	case RTE_CRYPTO_ASYM_XFORM_ECDSA:
>  	case RTE_CRYPTO_ASYM_XFORM_ECPM:
> +	case RTE_CRYPTO_ASYM_XFORM_SM2:
>  	default:
>  		break;
>  	}
> @@ -1806,12 +1807,14 @@ test_ecpm_all_curve(void)  }
> 
>  static int
> -_test_sm2_sign(bool rnd_secret)
> +test_sm2_sign(void)
>  {
>  	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
>  	struct crypto_testsuite_sm2_params input_params =
> sm2_param_fp256;
> +	const struct rte_cryptodev_asymmetric_xform_capability *capa;
>  	struct rte_mempool *sess_mpool = ts_params->session_mpool;
>  	struct rte_mempool *op_mpool = ts_params->op_mpool;
> +	struct rte_cryptodev_asym_capability_idx idx;
>  	uint8_t dev_id = ts_params->valid_devs[0];
>  	struct rte_crypto_op *result_op = NULL;
>  	uint8_t output_buf_r[TEST_DATA_SIZE];
> @@ -1822,6 +1825,12 @@ _test_sm2_sign(bool rnd_secret)
>  	int ret, status = TEST_SUCCESS;
>  	void *sess = NULL;
> 
> +	/* Check SM2 capability */
> +	idx.type = RTE_CRYPTO_ASYM_XFORM_SM2;
> +	capa = rte_cryptodev_asym_capability_get(dev_id, &idx);
> +	if (capa == NULL)
> +		return -ENOTSUP;
> +
>  	/* Setup crypto op data structure */
>  	op = rte_crypto_op_alloc(op_mpool,
> RTE_CRYPTO_OP_TYPE_ASYMMETRIC);
> -	0x8d, 0x8d, 0xb5, 0x40, 0xe3, 0xfb, 0x98, 0xf9,
> -	0x8c, 0xe4, 0x58, 0x60, 0xf2, 0x78, 0x8f, 0xd9,
> -	0xbf, 0xb8, 0x47, 0x73, 0x88, 0xc1, 0xd1, 0xcd,
> -	0x2d, 0xdb, 0xe3, 0xc1, 0x44, 0x30, 0x25, 0x86
> +	0x5A, 0x3C, 0x96, 0x3E, 0x1C, 0xB4, 0x19, 0xF9,
> +	0xD7, 0x78, 0xB8, 0xCE, 0xFF, 0x9D, 0xB1, 0x31,
> +	0x77, 0xDB, 0xA0, 0xFE, 0x84, 0x61, 0x1A, 0xD9,
> +	0x4E, 0xFF, 0x82, 0x13, 0x1C, 0xCA, 0x04, 0x75,
>  };
> 
>  static uint8_t fp256_id[] = {
> @@ -68,6 +69,13 @@ static uint8_t fp256_message[] = {
>  	0x64, 0x69, 0x67, 0x65, 0x73, 0x74
>  };
> 
> +static uint8_t fp256_digest[] = {
> +	0x0F, 0xB5, 0xCE, 0xF3, 0x3C, 0xB7, 0xD1, 0x35,
> +	0xA9, 0x3A, 0xC7, 0xA7, 0x89, 0x2A, 0x6D, 0x9A,
> +	0xF3, 0x1E, 0xC5, 0x38, 0xD3, 0x65, 0x1B, 0xB9,
> +	0xDF, 0x5F, 0x7F, 0x4A, 0xD8, 0x89, 0x57, 0xF1 };
> +
>  static uint8_t fp256_cipher[] = {
>  	0x30, 0x78, 0x02, 0x21, 0x00, 0xAB, 0xBD, 0xE8,
>  	0xE8, 0x80, 0x93, 0x36, 0x77, 0xB6, 0x44, 0x47, @@ -121,6 +129,10
> @@ struct crypto_testsuite_sm2_params sm2_param_fp256 = {
>  		.data = fp256_message,
>  		.length = sizeof(fp256_message),
>  	},
> +	.digest = {
> +		.data = fp256_digest,
> +		.length = sizeof(fp256_digest),
> +	},
>  	.cipher = {
>  		.data = fp256_cipher,
>  		.length = sizeof(fp256_cipher),
> --
> 2.25.1

Acked-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>


  reply	other threads:[~2023-09-26 20:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  9:35 [v1 0/6] cryptodev: support digest message in SM2 Gowrishankar Muthukrishnan
2023-08-10  9:35 ` [v1 1/6] crypto/openssl: include SM2 in asymmetric capabilities Gowrishankar Muthukrishnan
2023-09-26 19:53   ` Kusztal, ArkadiuszX
2023-08-10  9:35 ` [v1 2/6] cryptodev: add RNG capability in EC based xform Gowrishankar Muthukrishnan
2023-09-26 19:53   ` Kusztal, ArkadiuszX
2023-08-10  9:35 ` [v1 3/6] cryptodev: add hash support in asymmetric capability Gowrishankar Muthukrishnan
2023-09-26 20:03   ` Kusztal, ArkadiuszX
2023-09-27  5:55     ` Gowrishankar Muthukrishnan
2023-08-10  9:35 ` [v1 4/6] cryptodev: use generic EC xform params for SM2 Gowrishankar Muthukrishnan
2023-09-26 20:05   ` Kusztal, ArkadiuszX
2023-08-10  9:35 ` [v1 5/6] app/test: check asymmetric capabilities in SM2 test Gowrishankar Muthukrishnan
2023-09-26 20:05   ` Kusztal, ArkadiuszX [this message]
2023-08-10  9:35 ` [v1 6/6] crypto/cnxk: add SM2 support Gowrishankar Muthukrishnan
2023-09-14  7:21 ` [v1 0/6] cryptodev: support digest message in SM2 Gowrishankar Muthukrishnan
2023-09-27 11:37 ` [PATCH v2 0/7] " Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 1/7] crypto/openssl: include SM2 in asymmetric capabilities Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 2/7] cryptodev: set private and public keys in EC session Gowrishankar Muthukrishnan
2023-09-28 12:44     ` Power, Ciara
2023-09-28 13:12       ` Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 3/7] cryptodev: add RNG capability in EC based xform Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 4/7] cryptodev: add hash algorithms in asymmetric capability Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 5/7] cryptodev: use generic EC xform params for SM2 Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 6/7] app/test: check asymmetric capabilities in SM2 test Gowrishankar Muthukrishnan
2023-09-27 11:37   ` [PATCH v2 7/7] crypto/cnxk: add SM2 support Gowrishankar Muthukrishnan
2023-09-28 17:09   ` [PATCH v3 0/7] cryptodev: support digest message in SM2 Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 1/7] crypto/openssl: include SM2 in asymmetric capabilities Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 2/7] cryptodev: add hash algorithms in asymmetric capability Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 3/7] cryptodev: use generic EC xform params for SM2 Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 4/7] cryptodev: set private and public keys in EC session Gowrishankar Muthukrishnan
2023-09-29 12:47       ` Power, Ciara
2023-09-28 17:09     ` [PATCH v3 5/7] cryptodev: add RNG capability in EC based xform Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 6/7] crypto/cnxk: add SM2 support Gowrishankar Muthukrishnan
2023-09-28 17:09     ` [PATCH v3 7/7] app/test: check asymmetric capabilities in SM2 test Gowrishankar Muthukrishnan
2023-10-09 13:54     ` [PATCH v4 0/7] cryptodev: support digest message in SM2 Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 1/7] crypto/openssl: include SM2 in asymmetric capabilities Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 2/7] cryptodev: add hash algorithms in asymmetric capability Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 3/7] cryptodev: use generic EC xform params for SM2 Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 4/7] cryptodev: set private and public keys in EC session Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 5/7] cryptodev: add RNG capability in EC based xform Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 6/7] crypto/cnxk: add SM2 support Gowrishankar Muthukrishnan
2023-10-09 13:54       ` [PATCH v4 7/7] app/test: check asymmetric capabilities in SM2 test Gowrishankar Muthukrishnan
2023-10-09 19:07       ` [PATCH v4 0/7] cryptodev: support digest message in SM2 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=PH0PR11MB501303497E8CFB4FC3325AE19FC3A@PH0PR11MB5013.namprd11.prod.outlook.com \
    --to=arkadiuszx.kusztal@intel.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=gmuthukrishn@marvell.com \
    --cc=kai.ji@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).