[dpdk-dev] [PATCH v4 1/2] test/crypto: add rsa and mod test application

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Mon Jul 9 20:16:31 CEST 2018



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma at caviumnetworks.com]
> Sent: Thursday, July 5, 2018 4:54 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: dev at dpdk.org; pathreya at caviumnetworks.com; Sunila Sahu
> <sunila.sahu at caviumnetworks.com>; Ashish Gupta
> <ashish.gupta at caviumnetworks.com>
> Subject: [PATCH v4 1/2] test/crypto: add rsa and mod test application

Retitle to "add RSA and Mod tests"? No need to use "test application".

> 
> From: Sunila Sahu <sunila.sahu at caviumnetworks.com>
> 
> Test application include test case for :
> - RSA encrypt, decrypt, sign and verify
> - Modular Inversion and Exponentiation
> 
> Test cases uses predefined test vectors.
> 
> Signed-off-by: Sunila Sahu <sunila.sahu at caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma at caviumnetworks.com>
> Signed-off-by: Ashish Gupta <ashish.gupta at caviumnetworks.com>
> ---
>  test/test/Makefile                          |   1 +
>  test/test/meson.build                       |   1 +
>  test/test/test_cryptodev_asym.c             | 836
> ++++++++++++++++++++++++++++
>  test/test/test_cryptodev_asym_util.h        |  45 ++
>  test/test/test_cryptodev_mod_test_vectors.h | 103 ++++
> test/test/test_cryptodev_rsa_test_vectors.h |  90 +++
>  6 files changed, 1076 insertions(+)
> 
> diff --git a/test/test/Makefile b/test/test/Makefile index eccc8ef..d6fb88f
> 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -179,6 +179,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) +=
> test_pmd_ring_perf.c
> 
>  SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
>  SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
> +SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
> 
>  ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
>  SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c diff --git
> a/test/test/meson.build b/test/test/meson.build index a907fd2..06cd6f7 100644
> --- a/test/test/meson.build
> +++ b/test/test/meson.build
> @@ -22,6 +22,7 @@ test_sources = files('commands.c',
>  	'test_cpuflags.c',
>  	'test_crc.c',
>  	'test_cryptodev.c',
> +	'test_cryptodev_asym.c',
>  	'test_cryptodev_blockcipher.c',
>  	'test_cycles.c',
>  	'test_debug.c',

Add new test to test_names list in meson.build.


> diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asym.c
> new file mode 100644 index 0000000..9b6ffac
> --- /dev/null
> +++ b/test/test/test_cryptodev_asym.c
> @@ -0,0 +1,836 @@

...

> +	snprintf(test_msg,
> +			ASYM_TEST_MSG_LEN,
> +			"Modinv :%s length:%lu\n",
> +			asym_op->modinv.base.data,
> +			asym_op->modinv.base.length);

There is a compilation error on 32 bits:

test/test/test_cryptodev_asym.c:1046:25: error: format '%lu' expects argument of type 'long unsigned int',
but argument 5 has type 'size_t {aka unsigned int}' [-Werror=format=]
    "Modinv :%s length:%lu\n",
                       ~~^
                       %u
test/test/test_cryptodev_asym.c:1048:4:
    asym_op->modinv.base.length);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the dev mailing list