All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library
@ 2017-05-26 10:16 Pablo de Lara
  2017-05-26 10:16 ` [PATCH 1/2] crypto/aesni_gcm: migrate " Pablo de Lara
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-05-26 10:16 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

AES-NI GCM PMD migrated previously from Multi-buffer Crypto library
to ISA-L Crypto library, to support several features that were not
supported by that time, such as GMAC algorithm and Scatter-gather list.

Since version 0.45, Multi-buffer library (https://github.com/01org/intel-ipsec-mb)
supports all these features, the PMD can link against this library again.

This will improve maintainability, as now AESNI GCM PMD will share
the same library as AESNI MB PMD, having one less library to link against.
It also adds support for 192-bit keys.

In terms of performance, there is a marginal difference between those libraries,
within a 0.5% difference for several buffer sizes.

This patchset is migrating the PMD to link against Multi-buffer library v0.45.
The next version will be released in the coming months, which contains
some improvements and API changes, so this patchset will be rebased to
support it, if it is released before the merge deadline.

Pablo de Lara (2):
  crypto/aesni_gcm: migrate to Multi-buffer library
  test/crypto: add AES GCM 192 tests

 devtools/test-build.sh                           |   4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              |  18 +-
 doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
 doc/guides/rel_notes/release_17_08.rst           |   8 +
 drivers/crypto/aesni_gcm/Makefile                |  10 +-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         | 130 ++++++++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         |  90 +++---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  15 +-
 mk/rte.app.mk                                    |   3 +-
 test/test/test_cryptodev.c                       | 116 ++++++++
 test/test/test_cryptodev_gcm_test_vectors.h      | 357 +++++++++++++++++++++++
 12 files changed, 696 insertions(+), 77 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/2] crypto/aesni_gcm: migrate to Multi-buffer library
  2017-05-26 10:16 [PATCH 0/2] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
@ 2017-05-26 10:16 ` Pablo de Lara
  2017-05-26 10:16 ` [PATCH 2/2] test/crypto: add AES GCM 192 tests Pablo de Lara
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-05-26 10:16 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

Since Intel Multi Buffer library for IPSec has been updated to
support Scatter Gather List, the AESNI GCM PMD can link
to this library, instead of the ISA-L library.

This move eases the maintainance of the driver, as it will
use the same library as the AESNI MB PMD.
It also adds support for 192-bit keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 devtools/test-build.sh                           |   4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              |  18 ++--
 doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
 doc/guides/rel_notes/release_17_08.rst           |   8 ++
 drivers/crypto/aesni_gcm/Makefile                |  10 +-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         | 130 ++++++++++++++++++++++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         |  90 ++++++++--------
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  18 ++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  15 +--
 mk/rte.app.mk                                    |   3 +-
 10 files changed, 223 insertions(+), 77 deletions(-)

diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 61bdce7..81b57a4 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -38,7 +38,6 @@ default_path=$PATH
 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
 # - DPDK_DEP_ARCHIVE
 # - DPDK_DEP_CFLAGS
-# - DPDK_DEP_ISAL_CRYPTO (y/[n])
 # - DPDK_DEP_LDFLAGS
 # - DPDK_DEP_MOFED (y/[n])
 # - DPDK_DEP_NUMA (y/[n])
@@ -121,7 +120,6 @@ reset_env ()
 	unset CROSS
 	unset DPDK_DEP_ARCHIVE
 	unset DPDK_DEP_CFLAGS
-	unset DPDK_DEP_ISAL_CRYPTO
 	unset DPDK_DEP_LDFLAGS
 	unset DPDK_DEP_MOFED
 	unset DPDK_DEP_NUMA
@@ -182,7 +180,7 @@ config () # <directory> <target> <options>
 		sed -ri   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
 		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
-		test "$DPDK_DEP_ISAL_CRYPTO" != y || \
+		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
 		test -z "$LIBSSO_SNOW3G_PATH" || \
 		sed -ri         's,(PMD_SNOW3G=)n,\1y,' $1/.config
diff --git a/doc/guides/cryptodevs/aesni_gcm.rst b/doc/guides/cryptodevs/aesni_gcm.rst
index 84cdc52..10282a1 100644
--- a/doc/guides/cryptodevs/aesni_gcm.rst
+++ b/doc/guides/cryptodevs/aesni_gcm.rst
@@ -1,5 +1,5 @@
 ..  BSD LICENSE
-    Copyright(c) 2016 Intel Corporation. All rights reserved.
+    Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
@@ -32,8 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
 
 
 The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode crypto driver
-support for utilizing Intel ISA-L crypto library, which provides operation acceleration
-through the AES-NI instruction sets for AES-GCM authenticated cipher algorithm.
+support for utilizing Intel multi buffer library (see AES-NI Multi-buffer PMD documentation
+to learn more about it, including installation).
 
 Features
 --------
@@ -49,19 +49,15 @@ Authentication algorithms:
 * RTE_CRYPTO_AUTH_AES_GCM
 * RTE_CRYPTO_AUTH_AES_GMAC
 
-Installation
-------------
-
-To build DPDK with the AESNI_GCM_PMD the user is required to install
-the ``libisal_crypto`` library in the build environment.
-For download and more details please visit `<https://github.com/01org/isa-l_crypto>`_.
-
 Initialization
 --------------
 
 In order to enable this virtual crypto PMD, user must:
 
-* Install the ISA-L crypto library (explained in Installation section).
+* Export the environmental variable AESNI_MULTI_BUFFER_LIB_PATH with the path where
+  the library was extracted.
+
+* Build the multi buffer library (go to Installation section in AES-NI MB PMD documentation).
 
 * Set CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=y in config/common_base.
 
diff --git a/doc/guides/cryptodevs/features/aesni_gcm.ini b/doc/guides/cryptodevs/features/aesni_gcm.ini
index 5d9e119..0f11fef 100644
--- a/doc/guides/cryptodevs/features/aesni_gcm.ini
+++ b/doc/guides/cryptodevs/features/aesni_gcm.ini
@@ -7,7 +7,9 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 CPU AESNI              = Y
-
+CPU SSE                = Y
+CPU AVX                = Y
+CPU AVX2               = Y
 ;
 ; Supported crypto algorithms of the 'aesni_gcm' crypto driver.
 ;
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index 74aae10..724a880 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -41,6 +41,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+**Updated the AES-NI GCM PMD.**
+
+  The AES-NI GCM PMD was migrated from the ISA-L library to the Multi Buffer
+  library, as the latter library has Scatter Gather List support
+  now. The migration entailed adding additional support for:
+
+  * 192-bit key.
+
 
 Resolved Issues
 ---------------
diff --git a/drivers/crypto/aesni_gcm/Makefile b/drivers/crypto/aesni_gcm/Makefile
index 59a7c6a..4412894 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2016 Intel Corporation. All rights reserved.
+#   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
 #   modification, are permitted provided that the following conditions
@@ -31,6 +31,9 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 ifneq ($(MAKECMDGOALS),clean)
+ifeq ($(AESNI_MULTI_BUFFER_LIB_PATH),)
+$(error "Please define AESNI_MULTI_BUFFER_LIB_PATH environment variable")
+endif
 endif
 
 # library name
@@ -47,7 +50,10 @@ LIBABIVER := 1
 EXPORT_MAP := rte_pmd_aesni_gcm_version.map
 
 # external library dependencies
-LDLIBS += -lisal_crypto
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
+LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+LDLIBS += -lcrypto
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm_pmd.c
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
index e9de654..c6e647a 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -37,7 +37,32 @@
 #define LINUX
 #endif
 
-#include <isa-l_crypto/aes_gcm.h>
+#include <gcm_defines.h>
+#include <aux_funcs.h>
+
+/** Supported vector modes */
+enum aesni_gcm_vector_mode {
+	RTE_AESNI_GCM_NOT_SUPPORTED = 0,
+	RTE_AESNI_GCM_SSE,
+	RTE_AESNI_GCM_AVX,
+	RTE_AESNI_GCM_AVX2,
+	RTE_AESNI_GCM_VECTOR_NUM
+};
+
+enum aesni_gcm_key {
+	AESNI_GCM_KEY_128,
+	AESNI_GCM_KEY_192,
+	AESNI_GCM_KEY_256,
+	AESNI_GCM_KEY_NUM
+};
+
+
+typedef void (*aesni_gcm_t)(struct gcm_data *my_ctx_data, uint8_t *out,
+		const uint8_t *in, uint64_t plaintext_len, uint8_t *iv,
+		const uint8_t *aad, uint64_t aad_len,
+		uint8_t *auth_tag, uint64_t auth_tag_len);
+
+typedef void (*aesni_gcm_precomp_t)(const void *key, struct gcm_data *my_ctx_data);
 
 typedef void (*aesni_gcm_init_t)(struct gcm_data *my_ctx_data,
 		uint8_t *iv,
@@ -53,10 +78,109 @@ typedef void (*aesni_gcm_finalize_t)(struct gcm_data *my_ctx_data,
 		uint8_t *auth_tag,
 		uint64_t auth_tag_len);
 
+/** GCM library function pointer table */
 struct aesni_gcm_ops {
+	aesni_gcm_t enc;        /**< GCM encode function pointer */
+	aesni_gcm_t dec;        /**< GCM decode function pointer */
+	aesni_gcm_precomp_t precomp;    /**< GCM pre-compute */
 	aesni_gcm_init_t init;
-	aesni_gcm_update_t update;
+	aesni_gcm_update_t update_enc;
+	aesni_gcm_update_t update_dec;
 	aesni_gcm_finalize_t finalize;
 };
 
+static const struct aesni_gcm_ops gcm_ops[RTE_AESNI_GCM_VECTOR_NUM][AESNI_GCM_KEY_NUM] = {
+	[RTE_AESNI_GCM_NOT_SUPPORTED] = {
+		[AESNI_GCM_KEY_128] = {NULL},
+		[AESNI_GCM_KEY_192] = {NULL},
+		[AESNI_GCM_KEY_256] = {NULL}
+	},
+	[RTE_AESNI_GCM_SSE] = {
+		[AESNI_GCM_KEY_128] = {
+			aesni_gcm128_enc_sse,
+			aesni_gcm128_dec_sse,
+			aesni_gcm128_pre_sse,
+			aesni_gcm128_init_sse,
+			aesni_gcm128_enc_update_sse,
+			aesni_gcm128_dec_update_sse,
+			aesni_gcm128_enc_finalize_sse
+		},
+		[AESNI_GCM_KEY_192] = {
+			aesni_gcm192_enc_sse,
+			aesni_gcm192_dec_sse,
+			aesni_gcm192_pre_sse,
+			aesni_gcm192_init_sse,
+			aesni_gcm192_enc_update_sse,
+			aesni_gcm192_dec_update_sse,
+			aesni_gcm192_enc_finalize_sse
+		},
+		[AESNI_GCM_KEY_256] = {
+			aesni_gcm256_enc_sse,
+			aesni_gcm256_dec_sse,
+			aesni_gcm256_pre_sse,
+			aesni_gcm256_init_sse,
+			aesni_gcm256_enc_update_sse,
+			aesni_gcm256_dec_update_sse,
+			aesni_gcm256_enc_finalize_sse
+		}
+	},
+	[RTE_AESNI_GCM_AVX] = {
+		[AESNI_GCM_KEY_128] = {
+			aesni_gcm128_enc_avx_gen2,
+			aesni_gcm128_dec_avx_gen2,
+			aesni_gcm128_pre_avx_gen2,
+			aesni_gcm128_init_avx_gen2,
+			aesni_gcm128_enc_update_avx_gen2,
+			aesni_gcm128_dec_update_avx_gen2,
+			aesni_gcm128_enc_finalize_avx_gen2
+		},
+		[AESNI_GCM_KEY_192] = {
+			aesni_gcm192_enc_avx_gen2,
+			aesni_gcm192_dec_avx_gen2,
+			aesni_gcm192_pre_avx_gen2,
+			aesni_gcm192_init_avx_gen2,
+			aesni_gcm192_enc_update_avx_gen2,
+			aesni_gcm192_dec_update_avx_gen2,
+			aesni_gcm192_enc_finalize_avx_gen2
+		},
+		[AESNI_GCM_KEY_256] = {
+			aesni_gcm256_enc_avx_gen2,
+			aesni_gcm256_dec_avx_gen2,
+			aesni_gcm256_pre_avx_gen2,
+			aesni_gcm256_init_avx_gen2,
+			aesni_gcm256_enc_update_avx_gen2,
+			aesni_gcm256_dec_update_avx_gen2,
+			aesni_gcm256_enc_finalize_avx_gen2
+		}
+	},
+	[RTE_AESNI_GCM_AVX2] = {
+		[AESNI_GCM_KEY_128] = {
+			aesni_gcm128_enc_avx_gen4,
+			aesni_gcm128_dec_avx_gen4,
+			aesni_gcm128_pre_avx_gen4,
+			aesni_gcm128_init_avx_gen4,
+			aesni_gcm128_enc_update_avx_gen4,
+			aesni_gcm128_dec_update_avx_gen4,
+			aesni_gcm128_enc_finalize_avx_gen4
+		},
+		[AESNI_GCM_KEY_192] = {
+			aesni_gcm192_enc_avx_gen4,
+			aesni_gcm192_dec_avx_gen4,
+			aesni_gcm192_pre_avx_gen4,
+			aesni_gcm192_init_avx_gen4,
+			aesni_gcm192_enc_update_avx_gen4,
+			aesni_gcm192_dec_update_avx_gen4,
+			aesni_gcm192_enc_finalize_avx_gen4
+		},
+		[AESNI_GCM_KEY_256] = {
+			aesni_gcm256_enc_avx_gen4,
+			aesni_gcm256_dec_avx_gen4,
+			aesni_gcm256_pre_avx_gen4,
+			aesni_gcm256_init_avx_gen4,
+			aesni_gcm256_enc_update_avx_gen4,
+			aesni_gcm256_dec_update_avx_gen4,
+			aesni_gcm256_enc_finalize_avx_gen4
+		}
+	}
+};
 #endif /* _AESNI_GCM_OPS_H_ */
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 101ef98..e90c5dc 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -42,37 +42,11 @@
 
 #include "aesni_gcm_pmd_private.h"
 
-/** GCM encode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_enc[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_enc_update,
-				aesni_gcm128_enc_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_enc_update,
-				aesni_gcm256_enc_finalize
-		}
-};
-
-/** GCM decode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_dec[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_dec_update,
-				aesni_gcm128_dec_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_dec_update,
-				aesni_gcm256_dec_finalize
-		}
-};
 
 /** Parse crypto xform chain and set private session parameters */
 int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform)
 {
 	const struct rte_crypto_sym_xform *auth_xform;
@@ -119,20 +93,21 @@ aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
 	/* Check key length and calculate GCM pre-compute. */
 	switch (cipher_xform->cipher.key.length) {
 	case 16:
-		aesni_gcm128_pre(cipher_xform->cipher.key.data, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_128;
-
+		break;
+	case 24:
+		sess->key = AESNI_GCM_KEY_192;
 		break;
 	case 32:
-		aesni_gcm256_pre(cipher_xform->cipher.key.data, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_256;
-
 		break;
 	default:
 		GCM_LOG_ERR("Unsupported cipher key length");
 		return -EINVAL;
 	}
 
+	gcm_ops[sess->key].precomp(cipher_xform->cipher.key.data,
+					   &sess->gdata);
 	return 0;
 }
 
@@ -157,7 +132,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op)
 		sess = (struct aesni_gcm_session *)
 			((struct rte_cryptodev_sym_session *)_sess)->_private;
 
-		if (unlikely(aesni_gcm_set_session_parameters(sess,
+		if (unlikely(aesni_gcm_set_session_parameters(qp->ops, sess,
 				op->xform) != 0)) {
 			rte_mempool_put(qp->sess_mp, _sess);
 			sess = NULL;
@@ -178,7 +153,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op)
  *
  */
 static int
-process_gcm_crypto_op(struct rte_crypto_sym_op *op,
+process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op,
 		struct aesni_gcm_session *session)
 {
 	uint8_t *src, *dst;
@@ -242,12 +217,12 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 
 	if (session->op == AESNI_GCM_OP_AUTHENTICATED_ENCRYPTION) {
 
-		aesni_gcm_enc[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata,
 				op->cipher.iv.data,
 				op->auth.aad.data,
 				(uint64_t)op->auth.aad.length);
 
-		aesni_gcm_enc[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_enc(&session->gdata, dst, src,
 				(uint64_t)part_len);
 		total_len = op->cipher.data.length - part_len;
 
@@ -261,13 +236,13 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_enc[session->key].update(&session->gdata,
+			qp->ops[session->key].update_enc(&session->gdata,
 					dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_enc[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata,
 				op->auth.digest.data,
 				(uint64_t)op->auth.digest.length);
 	} else { /* session->op == AESNI_GCM_OP_AUTHENTICATED_DECRYPTION */
@@ -280,12 +255,12 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			return -1;
 		}
 
-		aesni_gcm_dec[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata,
 				op->cipher.iv.data,
 				op->auth.aad.data,
 				(uint64_t)op->auth.aad.length);
 
-		aesni_gcm_dec[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_dec(&session->gdata, dst, src,
 				(uint64_t)part_len);
 		total_len = op->cipher.data.length - part_len;
 
@@ -299,13 +274,13 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_dec[session->key].update(&session->gdata,
+			qp->ops[session->key].update_dec(&session->gdata,
 					dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_dec[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata,
 				auth_tag,
 				(uint64_t)op->auth.digest.length);
 	}
@@ -399,7 +374,7 @@ aesni_gcm_pmd_dequeue_burst(void *queue_pair,
 			break;
 		}
 
-		retval = process_gcm_crypto_op(ops[i]->sym, sess);
+		retval = process_gcm_crypto_op(qp, ops[i]->sym, sess);
 		if (retval < 0) {
 			ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 			qp->qp_stats.dequeue_err_count++;
@@ -438,6 +413,7 @@ aesni_gcm_create(const char *name,
 {
 	struct rte_cryptodev *dev;
 	struct aesni_gcm_private *internals;
+	enum aesni_gcm_vector_mode vector_mode;
 
 	if (init_params->name[0] == '\0')
 		snprintf(init_params->name, sizeof(init_params->name),
@@ -449,6 +425,18 @@ aesni_gcm_create(const char *name,
 		return -EFAULT;
 	}
 
+	/* Check CPU for supported vector instruction set */
+	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
+		vector_mode = RTE_AESNI_GCM_AVX2;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
+		vector_mode = RTE_AESNI_GCM_AVX;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
+		vector_mode = RTE_AESNI_GCM_SSE;
+	else {
+		GCM_LOG_ERR("Vector instructions are not supported by CPU");
+		return -EFAULT;
+	}
+
 	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct aesni_gcm_private), init_params->socket_id);
 	if (dev == NULL) {
@@ -468,8 +456,24 @@ aesni_gcm_create(const char *name,
 			RTE_CRYPTODEV_FF_CPU_AESNI |
 			RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER;
 
+	switch (vector_mode) {
+	case RTE_AESNI_GCM_SSE:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
+		break;
+	case RTE_AESNI_GCM_AVX:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
+		break;
+	case RTE_AESNI_GCM_AVX2:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;
+		break;
+	default:
+		break;
+	}
+
 	internals = dev->data->dev_private;
 
+	internals->vector_mode = vector_mode;
+
 	internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
 	internals->max_nb_sessions = init_params->max_nb_sessions;
 
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 1fc047b..4e9129f 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -49,7 +49,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -74,7 +74,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -99,7 +99,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.iv_size = {
 					.min = 12,
@@ -247,6 +247,7 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		 int socket_id)
 {
 	struct aesni_gcm_qp *qp = NULL;
+	struct aesni_gcm_private *internals = dev->data->dev_private;
 
 	/* Free memory prior to re-allocation if needed. */
 	if (dev->data->queue_pairs[qp_id] != NULL)
@@ -264,6 +265,8 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	if (aesni_gcm_pmd_qp_set_unique_name(dev, qp))
 		goto qp_setup_cleanup;
 
+	qp->ops = (const struct aesni_gcm_ops *)gcm_ops[internals->vector_mode];
+
 	qp->processed_pkts = aesni_gcm_pmd_qp_create_processed_pkts_ring(qp,
 			qp_conf->nb_descriptors, socket_id);
 	if (qp->processed_pkts == NULL)
@@ -314,15 +317,18 @@ aesni_gcm_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 
 /** Configure a aesni gcm session from a crypto xform chain */
 static void *
-aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,
+aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev,
 		struct rte_crypto_sym_xform *xform,	void *sess)
 {
+	struct aesni_gcm_private *internals = dev->data->dev_private;
+
 	if (unlikely(sess == NULL)) {
 		GCM_LOG_ERR("invalid session struct");
 		return NULL;
 	}
 
-	if (aesni_gcm_set_session_parameters(sess, xform) != 0) {
+	if (aesni_gcm_set_session_parameters(gcm_ops[internals->vector_mode],
+			sess, xform) != 0) {
 		GCM_LOG_ERR("failed configure session parameters");
 		return NULL;
 	}
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
index 0496b44..9a81c88 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -58,6 +58,8 @@
 
 /** private data structure for each virtual AESNI GCM device */
 struct aesni_gcm_private {
+	enum aesni_gcm_vector_mode vector_mode;
+	/**< Vector mode */
 	unsigned max_nb_queue_pairs;
 	/**< Max number of queue pairs supported by device */
 	unsigned max_nb_sessions;
@@ -69,6 +71,8 @@ struct aesni_gcm_qp {
 	/**< Queue Pair Identifier */
 	char name[RTE_CRYPTODEV_NAME_LEN];
 	/**< Unique Queue Pair Name */
+	const struct aesni_gcm_ops *ops;
+	/**< Architecture dependent function pointer table of the gcm APIs */
 	struct rte_ring *processed_pkts;
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
@@ -83,11 +87,6 @@ enum aesni_gcm_operation {
 	AESNI_GCM_OP_AUTHENTICATED_DECRYPTION
 };
 
-enum aesni_gcm_key {
-	AESNI_GCM_KEY_128,
-	AESNI_GCM_KEY_256
-};
-
 /** AESNI GCM private session structure */
 struct aesni_gcm_session {
 	enum aesni_gcm_operation op;
@@ -101,6 +100,7 @@ struct aesni_gcm_session {
 
 /**
  * Setup GCM session parameters
+ * @param	ops	gcm ops function pointer table
  * @param	sess	aesni gcm session structure
  * @param	xform	crypto transform chain
  *
@@ -109,7 +109,8 @@ struct aesni_gcm_session {
  * - On failure returns error code < 0
  */
 extern int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform);
 
 
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index bcaf1b3..29a4abb 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -147,7 +147,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore
 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -lrte_pmd_aesni_mb
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm -lisal_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm -lcrypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -lrte_pmd_openssl -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)         += -lrte_pmd_qat -lcrypto
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/2] test/crypto: add AES GCM 192 tests
  2017-05-26 10:16 [PATCH 0/2] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2017-05-26 10:16 ` [PATCH 1/2] crypto/aesni_gcm: migrate " Pablo de Lara
@ 2017-05-26 10:16 ` Pablo de Lara
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-05-26 10:16 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

Added AES GCM tests for 192-bit keys, now that AES GCM PMD
supports it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 test/test/test_cryptodev.c                  | 116 +++++++++
 test/test/test_cryptodev_gcm_test_vectors.h | 357 ++++++++++++++++++++++++++++
 2 files changed, 473 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 029ce8a..bebedea 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -5158,6 +5158,48 @@ test_mb_AES_GCM_authenticated_encryption_test_case_7(void)
 }
 
 static int
+test_mb_AES_GCM_auth_encryption_test_case_192_1(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_1);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_2(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_2);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_3(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_3);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_4(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_4);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_5(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_5);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_6(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_6);
+}
+
+static int
+test_mb_AES_GCM_auth_encryption_test_case_192_7(void)
+{
+	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_192_7);
+}
+
+static int
 test_mb_AES_GCM_auth_encryption_test_case_256_1(void)
 {
 	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
@@ -5324,6 +5366,48 @@ test_mb_AES_GCM_authenticated_decryption_test_case_7(void)
 }
 
 static int
+test_mb_AES_GCM_auth_decryption_test_case_192_1(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_1);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_2(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_2);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_3(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_3);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_4(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_4);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_5(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_5);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_6(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_6);
+}
+
+static int
+test_mb_AES_GCM_auth_decryption_test_case_192_7(void)
+{
+	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_192_7);
+}
+
+static int
 test_mb_AES_GCM_auth_decryption_test_case_256_1(void)
 {
 	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
@@ -8274,6 +8358,38 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_mb_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_mb_AES_GCM_auth_decryption_test_case_192_7),
+
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_mb_AES_GCM_auth_encryption_test_case_256_1),
diff --git a/test/test/test_cryptodev_gcm_test_vectors.h b/test/test/test_cryptodev_gcm_test_vectors.h
index 5764edb..22d6b72 100644
--- a/test/test/test_cryptodev_gcm_test_vectors.h
+++ b/test/test/test_cryptodev_gcm_test_vectors.h
@@ -1002,6 +1002,363 @@ static const struct gcm_test_data gcm_test_case_8 = {
 	}
 };
 
+/** AES-192 Test Vectors */
+static const struct gcm_test_data gcm_test_case_192_1 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.ciphertext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.auth_tag = {
+		.data = {
+			0xCD, 0x33, 0xB2, 0x8A, 0xC7, 0x73, 0xF7, 0x4B,
+			0xA0, 0x0E, 0xD1, 0xF3, 0x12, 0x57, 0x24, 0x35
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_2 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 16
+	},
+	.ciphertext = {
+		.data = {
+			0x98, 0xE7, 0x24, 0x7C, 0x07, 0xF0, 0xFE, 0x41,
+			0x1C, 0x26, 0x7E, 0x43, 0x84, 0xB0, 0xF6, 0x00
+		},
+		.len = 16
+	},
+	.auth_tag = {
+		.data = {
+			0x2F, 0xF5, 0x8D, 0x80, 0x03, 0x39, 0x27, 0xAB,
+			0x8E, 0xF4, 0xD4, 0x58, 0x75, 0x14, 0xF0, 0xFB
+
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_3 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39, 0x1A, 0xAF, 0xD2, 0x55
+		},
+		.len = 64
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10, 0xAC, 0xAD, 0xE2, 0x56
+		},
+		.len = 64
+	},
+	.auth_tag = {
+		.data = {
+			0x99, 0x24, 0xA7, 0xC8, 0x58, 0x73, 0x36, 0xBF,
+			0xB1, 0x18, 0x02, 0x4D, 0xB8, 0x67, 0x4A, 0x14
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_4 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0x57, 0x5F, 0x03, 0xA0, 0x8D, 0x8F, 0x40, 0x26,
+			0xE5, 0x64, 0x1F, 0x5B, 0x5C, 0xC2, 0xFD, 0x4B
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_5 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xB6, 0x35, 0x56, 0xE7, 0xBA, 0x46, 0xA3, 0x38,
+			0xED, 0xAD, 0x79, 0x9F, 0xB3, 0x5B, 0x34, 0xA8
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_6 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xCA, 0x8A, 0x8A, 0x91, 0x5A, 0xF9, 0x76, 0xE3,
+			0xFF, 0x2C, 0xE4, 0x7D, 0xE5, 0x62, 0x75, 0x18
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_7 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xC2, 0xD8, 0x4C, 0x6B, 0xA8, 0x3B, 0xA5, 0x6B,
+			0x18, 0x9F, 0xE6, 0xEF, 0x66, 0x24, 0xDD, 0xDA
+		},
+		.len = 16
+	}
+};
+
 /** AES-256 Test Vectors */
 static const struct gcm_test_data gcm_test_case_256_1 = {
 	.key = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library
  2017-05-26 10:16 [PATCH 0/2] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2017-05-26 10:16 ` [PATCH 1/2] crypto/aesni_gcm: migrate " Pablo de Lara
  2017-05-26 10:16 ` [PATCH 2/2] test/crypto: add AES GCM 192 tests Pablo de Lara
@ 2017-06-28 11:32 ` Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
                     ` (5 more replies)
  2 siblings, 6 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-06-28 11:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

AES-NI GCM PMD migrated previously from Multi-buffer Crypto library to ISA-L Crypto library,
to support several features that were not supported by that time, such as GMAC algorithm
and Scatter-gather list.

Since version 0.45, Multi-buffer library (https://github.com/01org/intel-ipsec-mb)
supports all these features, the PMD can link against this library again (version 0.46 now).

This will improve maintainability, as now AESNI GCM PMD will share the same library as
AESNI MB PMD, having one less library to link against. It also adds support for 192-bit keys.

In terms of performance, it has been improved, especially for some architectures.

This patchset is migrating the PMD to link against Multi-buffer library v0.46.

Changes in v2:

- Supported Multi-buffer 0.46 library
- Added new tests to other PMD testsuites
- Rebased against latest dpdk-next-crypto code

Pablo de Lara (4):
  crypto/aesni_gcm: migrate to Multi-buffer library
  test/crypto: rename some tests
  test/crypto: add AES GCM 192 tests
  test/crypto: extend AES-GCM 192/256 to other PMDs

 devtools/test-build.sh                           |   4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              |  18 +-
 doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
 doc/guides/rel_notes/release_17_08.rst           |   8 +
 drivers/crypto/aesni_gcm/Makefile                |   9 +-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 ++++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         |  98 +++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  32 +-
 mk/rte.app.mk                                    |   3 +-
 test/test/test_cryptodev.c                       | 497 +++++++++++++++++------
 test/test/test_cryptodev_gcm_test_vectors.h      | 357 ++++++++++++++++
 12 files changed, 922 insertions(+), 223 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 1/4] crypto/aesni_gcm: migrate to Multi-buffer library
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
@ 2017-06-28 11:32   ` Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 2/4] test/crypto: rename some tests Pablo de Lara
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-06-28 11:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara, Sergio Gonzalez Monroy

Since Intel Multi Buffer library for IPSec has been updated to
support Scatter Gather List, the AESNI GCM PMD can link
to this library, instead of the ISA-L library.

This move eases the maintenance of the driver, as it will
use the same library as the AESNI MB PMD.
It also adds support for 192-bit keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 devtools/test-build.sh                           |  4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              | 18 ++---
 doc/guides/cryptodevs/features/aesni_gcm.ini     |  4 +-
 doc/guides/rel_notes/release_17_08.rst           |  8 ++
 drivers/crypto/aesni_gcm/Makefile                |  9 ++-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         | 97 +++++++++++++++++++++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         | 98 +++++++++++++-----------
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     | 18 +++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h | 32 ++++----
 mk/rte.app.mk                                    |  3 +-
 10 files changed, 202 insertions(+), 89 deletions(-)

diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 61bdce7..81b57a4 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -38,7 +38,6 @@ default_path=$PATH
 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
 # - DPDK_DEP_ARCHIVE
 # - DPDK_DEP_CFLAGS
-# - DPDK_DEP_ISAL_CRYPTO (y/[n])
 # - DPDK_DEP_LDFLAGS
 # - DPDK_DEP_MOFED (y/[n])
 # - DPDK_DEP_NUMA (y/[n])
@@ -121,7 +120,6 @@ reset_env ()
 	unset CROSS
 	unset DPDK_DEP_ARCHIVE
 	unset DPDK_DEP_CFLAGS
-	unset DPDK_DEP_ISAL_CRYPTO
 	unset DPDK_DEP_LDFLAGS
 	unset DPDK_DEP_MOFED
 	unset DPDK_DEP_NUMA
@@ -182,7 +180,7 @@ config () # <directory> <target> <options>
 		sed -ri   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
 		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
-		test "$DPDK_DEP_ISAL_CRYPTO" != y || \
+		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
 		test -z "$LIBSSO_SNOW3G_PATH" || \
 		sed -ri         's,(PMD_SNOW3G=)n,\1y,' $1/.config
diff --git a/doc/guides/cryptodevs/aesni_gcm.rst b/doc/guides/cryptodevs/aesni_gcm.rst
index 84cdc52..10282a1 100644
--- a/doc/guides/cryptodevs/aesni_gcm.rst
+++ b/doc/guides/cryptodevs/aesni_gcm.rst
@@ -1,5 +1,5 @@
 ..  BSD LICENSE
-    Copyright(c) 2016 Intel Corporation. All rights reserved.
+    Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
@@ -32,8 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
 
 
 The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode crypto driver
-support for utilizing Intel ISA-L crypto library, which provides operation acceleration
-through the AES-NI instruction sets for AES-GCM authenticated cipher algorithm.
+support for utilizing Intel multi buffer library (see AES-NI Multi-buffer PMD documentation
+to learn more about it, including installation).
 
 Features
 --------
@@ -49,19 +49,15 @@ Authentication algorithms:
 * RTE_CRYPTO_AUTH_AES_GCM
 * RTE_CRYPTO_AUTH_AES_GMAC
 
-Installation
-------------
-
-To build DPDK with the AESNI_GCM_PMD the user is required to install
-the ``libisal_crypto`` library in the build environment.
-For download and more details please visit `<https://github.com/01org/isa-l_crypto>`_.
-
 Initialization
 --------------
 
 In order to enable this virtual crypto PMD, user must:
 
-* Install the ISA-L crypto library (explained in Installation section).
+* Export the environmental variable AESNI_MULTI_BUFFER_LIB_PATH with the path where
+  the library was extracted.
+
+* Build the multi buffer library (go to Installation section in AES-NI MB PMD documentation).
 
 * Set CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=y in config/common_base.
 
diff --git a/doc/guides/cryptodevs/features/aesni_gcm.ini b/doc/guides/cryptodevs/features/aesni_gcm.ini
index 5d9e119..0f11fef 100644
--- a/doc/guides/cryptodevs/features/aesni_gcm.ini
+++ b/doc/guides/cryptodevs/features/aesni_gcm.ini
@@ -7,7 +7,9 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 CPU AESNI              = Y
-
+CPU SSE                = Y
+CPU AVX                = Y
+CPU AVX2               = Y
 ;
 ; Supported crypto algorithms of the 'aesni_gcm' crypto driver.
 ;
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index 842f46f..d894d98 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -75,6 +75,14 @@ New Features
 
   Added support for firmwares with multiple Ethernet ports per physical port.
 
+**Updated the AES-NI GCM PMD.**
+
+  The AES-NI GCM PMD was migrated from the ISA-L library to the Multi Buffer
+  library, as the latter library has Scatter Gather List support
+  now. The migration entailed adding additional support for:
+
+  * 192-bit key.
+
 
 Resolved Issues
 ---------------
diff --git a/drivers/crypto/aesni_gcm/Makefile b/drivers/crypto/aesni_gcm/Makefile
index 59a7c6a..6fca5e1 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2016 Intel Corporation. All rights reserved.
+#   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
 #   modification, are permitted provided that the following conditions
@@ -31,6 +31,9 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 ifneq ($(MAKECMDGOALS),clean)
+ifeq ($(AESNI_MULTI_BUFFER_LIB_PATH),)
+$(error "Please define AESNI_MULTI_BUFFER_LIB_PATH environment variable")
+endif
 endif
 
 # library name
@@ -47,7 +50,9 @@ LIBABIVER := 1
 EXPORT_MAP := rte_pmd_aesni_gcm_version.map
 
 # external library dependencies
-LDLIBS += -lisal_crypto
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
+LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm_pmd.c
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
index e9de654..d6a18ef 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -37,26 +37,109 @@
 #define LINUX
 #endif
 
-#include <isa-l_crypto/aes_gcm.h>
+#include <gcm_defines.h>
+#include <aux_funcs.h>
 
-typedef void (*aesni_gcm_init_t)(struct gcm_data *my_ctx_data,
-		uint8_t *iv,
+/** Supported vector modes */
+enum aesni_gcm_vector_mode {
+	RTE_AESNI_GCM_NOT_SUPPORTED = 0,
+	RTE_AESNI_GCM_SSE,
+	RTE_AESNI_GCM_AVX,
+	RTE_AESNI_GCM_AVX2,
+	RTE_AESNI_GCM_VECTOR_NUM
+};
+
+enum aesni_gcm_key {
+	AESNI_GCM_KEY_128,
+	AESNI_GCM_KEY_192,
+	AESNI_GCM_KEY_256,
+	AESNI_GCM_KEY_NUM
+};
+
+
+typedef void (*aesni_gcm_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data, uint8_t *out,
+		const uint8_t *in, uint64_t plaintext_len, const uint8_t *iv,
+		const uint8_t *aad, uint64_t aad_len,
+		uint8_t *auth_tag, uint64_t auth_tag_len);
+
+typedef void (*aesni_gcm_precomp_t)(const void *key, struct gcm_key_data *gcm_data);
+
+typedef void (*aesni_gcm_init_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
+		const uint8_t *iv,
 		uint8_t const *aad,
 		uint64_t aad_len);
 
-typedef void (*aesni_gcm_update_t)(struct gcm_data *my_ctx_data,
+typedef void (*aesni_gcm_update_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
 		uint8_t *out,
 		const uint8_t *in,
 		uint64_t plaintext_len);
 
-typedef void (*aesni_gcm_finalize_t)(struct gcm_data *my_ctx_data,
+typedef void (*aesni_gcm_finalize_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
 		uint8_t *auth_tag,
 		uint64_t auth_tag_len);
 
+/** GCM library function pointer table */
 struct aesni_gcm_ops {
+	aesni_gcm_t enc;        /**< GCM encode function pointer */
+	aesni_gcm_t dec;        /**< GCM decode function pointer */
+	aesni_gcm_precomp_t precomp;    /**< GCM pre-compute */
 	aesni_gcm_init_t init;
-	aesni_gcm_update_t update;
+	aesni_gcm_update_t update_enc;
+	aesni_gcm_update_t update_dec;
 	aesni_gcm_finalize_t finalize;
 };
 
+#define AES_GCM_FN(keylen, arch) \
+aes_gcm_enc_##keylen##_##arch,\
+aes_gcm_dec_##keylen##_##arch,\
+aes_gcm_pre_##keylen##_##arch,\
+aes_gcm_init_##keylen##_##arch,\
+aes_gcm_enc_##keylen##_update_##arch,\
+aes_gcm_dec_##keylen##_update_##arch,\
+aes_gcm_enc_##keylen##_finalize_##arch,
+
+static const struct aesni_gcm_ops gcm_ops[RTE_AESNI_GCM_VECTOR_NUM][AESNI_GCM_KEY_NUM] = {
+	[RTE_AESNI_GCM_NOT_SUPPORTED] = {
+		[AESNI_GCM_KEY_128] = {NULL},
+		[AESNI_GCM_KEY_192] = {NULL},
+		[AESNI_GCM_KEY_256] = {NULL}
+	},
+	[RTE_AESNI_GCM_SSE] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, sse)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, sse)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, sse)
+		}
+	},
+	[RTE_AESNI_GCM_AVX] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, avx_gen2)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, avx_gen2)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, avx_gen2)
+		}
+	},
+	[RTE_AESNI_GCM_AVX2] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, avx_gen4)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, avx_gen4)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, avx_gen4)
+		}
+	}
+};
 #endif /* _AESNI_GCM_OPS_H_ */
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 1b95c23..f09e7cd 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -43,37 +43,11 @@
 
 #include "aesni_gcm_pmd_private.h"
 
-/** GCM encode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_enc[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_enc_update,
-				aesni_gcm128_enc_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_enc_update,
-				aesni_gcm256_enc_finalize
-		}
-};
-
-/** GCM decode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_dec[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_dec_update,
-				aesni_gcm128_dec_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_dec_update,
-				aesni_gcm256_dec_finalize
-		}
-};
 
 /** Parse crypto xform chain and set private session parameters */
 int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform)
 {
 	const struct rte_crypto_sym_xform *auth_xform;
@@ -120,20 +94,21 @@ aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
 	/* Check key length and calculate GCM pre-compute. */
 	switch (cipher_xform->cipher.key.length) {
 	case 16:
-		aesni_gcm128_pre(cipher_xform->cipher.key.data, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_128;
-
+		break;
+	case 24:
+		sess->key = AESNI_GCM_KEY_192;
 		break;
 	case 32:
-		aesni_gcm256_pre(cipher_xform->cipher.key.data, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_256;
-
 		break;
 	default:
 		GCM_LOG_ERR("Unsupported cipher key length");
 		return -EINVAL;
 	}
 
+	gcm_ops[sess->key].precomp(cipher_xform->cipher.key.data,
+					   &sess->gdata_key);
 	return 0;
 }
 
@@ -158,7 +133,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op)
 		sess = (struct aesni_gcm_session *)
 			((struct rte_cryptodev_sym_session *)_sess)->_private;
 
-		if (unlikely(aesni_gcm_set_session_parameters(sess,
+		if (unlikely(aesni_gcm_set_session_parameters(qp->ops, sess,
 				op->xform) != 0)) {
 			rte_mempool_put(qp->sess_mp, _sess);
 			sess = NULL;
@@ -179,7 +154,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op)
  *
  */
 static int
-process_gcm_crypto_op(struct rte_crypto_sym_op *op,
+process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op,
 		struct aesni_gcm_session *session)
 {
 	uint8_t *src, *dst;
@@ -243,12 +218,14 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 
 	if (session->op == AESNI_GCM_OP_AUTHENTICATED_ENCRYPTION) {
 
-		aesni_gcm_enc[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				op->cipher.iv.data,
 				op->auth.aad.data,
 				(uint64_t)op->auth.aad.length);
 
-		aesni_gcm_enc[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_enc(&session->gdata_key,
+				&qp->gdata_ctx, dst, src,
 				(uint64_t)part_len);
 		total_len = op->cipher.data.length - part_len;
 
@@ -262,13 +239,15 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_enc[session->key].update(&session->gdata,
+			qp->ops[session->key].update_enc(&session->gdata_key,
+					&qp->gdata_ctx,
 					dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_enc[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				op->auth.digest.data,
 				(uint64_t)op->auth.digest.length);
 	} else { /* session->op == AESNI_GCM_OP_AUTHENTICATED_DECRYPTION */
@@ -281,12 +260,14 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			return -1;
 		}
 
-		aesni_gcm_dec[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				op->cipher.iv.data,
 				op->auth.aad.data,
 				(uint64_t)op->auth.aad.length);
 
-		aesni_gcm_dec[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_dec(&session->gdata_key,
+				&qp->gdata_ctx, dst, src,
 				(uint64_t)part_len);
 		total_len = op->cipher.data.length - part_len;
 
@@ -300,13 +281,15 @@ process_gcm_crypto_op(struct rte_crypto_sym_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_dec[session->key].update(&session->gdata,
+			qp->ops[session->key].update_dec(&session->gdata_key,
+					&qp->gdata_ctx,
 					dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_dec[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				auth_tag,
 				(uint64_t)op->auth.digest.length);
 	}
@@ -400,7 +383,7 @@ aesni_gcm_pmd_dequeue_burst(void *queue_pair,
 			break;
 		}
 
-		retval = process_gcm_crypto_op(ops[i]->sym, sess);
+		retval = process_gcm_crypto_op(qp, ops[i]->sym, sess);
 		if (retval < 0) {
 			ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 			qp->qp_stats.dequeue_err_count++;
@@ -439,6 +422,7 @@ aesni_gcm_create(const char *name,
 {
 	struct rte_cryptodev *dev;
 	struct aesni_gcm_private *internals;
+	enum aesni_gcm_vector_mode vector_mode;
 
 	if (init_params->name[0] == '\0')
 		snprintf(init_params->name, sizeof(init_params->name),
@@ -450,6 +434,18 @@ aesni_gcm_create(const char *name,
 		return -EFAULT;
 	}
 
+	/* Check CPU for supported vector instruction set */
+	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
+		vector_mode = RTE_AESNI_GCM_AVX2;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
+		vector_mode = RTE_AESNI_GCM_AVX;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
+		vector_mode = RTE_AESNI_GCM_SSE;
+	else {
+		GCM_LOG_ERR("Vector instructions are not supported by CPU");
+		return -EFAULT;
+	}
+
 	dev = rte_cryptodev_vdev_pmd_init(init_params->name,
 			sizeof(struct aesni_gcm_private), init_params->socket_id,
 			vdev);
@@ -470,8 +466,24 @@ aesni_gcm_create(const char *name,
 			RTE_CRYPTODEV_FF_CPU_AESNI |
 			RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER;
 
+	switch (vector_mode) {
+	case RTE_AESNI_GCM_SSE:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
+		break;
+	case RTE_AESNI_GCM_AVX:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
+		break;
+	case RTE_AESNI_GCM_AVX2:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;
+		break;
+	default:
+		break;
+	}
+
 	internals = dev->data->dev_private;
 
+	internals->vector_mode = vector_mode;
+
 	internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
 	internals->max_nb_sessions = init_params->max_nb_sessions;
 
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 7b68a20..cf30e5c 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -49,7 +49,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -74,7 +74,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -99,7 +99,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.iv_size = {
 					.min = 12,
@@ -247,6 +247,7 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		 int socket_id)
 {
 	struct aesni_gcm_qp *qp = NULL;
+	struct aesni_gcm_private *internals = dev->data->dev_private;
 
 	/* Free memory prior to re-allocation if needed. */
 	if (dev->data->queue_pairs[qp_id] != NULL)
@@ -264,6 +265,8 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	if (aesni_gcm_pmd_qp_set_unique_name(dev, qp))
 		goto qp_setup_cleanup;
 
+	qp->ops = (const struct aesni_gcm_ops *)gcm_ops[internals->vector_mode];
+
 	qp->processed_pkts = aesni_gcm_pmd_qp_create_processed_pkts_ring(qp,
 			qp_conf->nb_descriptors, socket_id);
 	if (qp->processed_pkts == NULL)
@@ -314,15 +317,18 @@ aesni_gcm_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 
 /** Configure a aesni gcm session from a crypto xform chain */
 static void *
-aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,
+aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev,
 		struct rte_crypto_sym_xform *xform,	void *sess)
 {
+	struct aesni_gcm_private *internals = dev->data->dev_private;
+
 	if (unlikely(sess == NULL)) {
 		GCM_LOG_ERR("invalid session struct");
 		return NULL;
 	}
 
-	if (aesni_gcm_set_session_parameters(sess, xform) != 0) {
+	if (aesni_gcm_set_session_parameters(gcm_ops[internals->vector_mode],
+			sess, xform) != 0) {
 		GCM_LOG_ERR("failed configure session parameters");
 		return NULL;
 	}
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
index 0496b44..8ce879f 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -58,6 +58,8 @@
 
 /** private data structure for each virtual AESNI GCM device */
 struct aesni_gcm_private {
+	enum aesni_gcm_vector_mode vector_mode;
+	/**< Vector mode */
 	unsigned max_nb_queue_pairs;
 	/**< Max number of queue pairs supported by device */
 	unsigned max_nb_sessions;
@@ -65,16 +67,20 @@ struct aesni_gcm_private {
 };
 
 struct aesni_gcm_qp {
-	uint16_t id;
-	/**< Queue Pair Identifier */
-	char name[RTE_CRYPTODEV_NAME_LEN];
-	/**< Unique Queue Pair Name */
+	const struct aesni_gcm_ops *ops;
+	/**< Architecture dependent function pointer table of the gcm APIs */
 	struct rte_ring *processed_pkts;
 	/**< Ring for placing process packets */
+	struct gcm_context_data gdata_ctx; /* (16 * 5) + 8 = 88 B */
+	/**< GCM parameters */
+	struct rte_cryptodev_stats qp_stats; /* 8 * 4 = 32 B */
+	/**< Queue pair statistics */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
-	/**< Queue pair statistics */
+	uint16_t id;
+	/**< Queue Pair Identifier */
+	char name[RTE_CRYPTODEV_NAME_LEN];
+	/**< Unique Queue Pair Name */
 } __rte_cache_aligned;
 
 
@@ -83,24 +89,19 @@ enum aesni_gcm_operation {
 	AESNI_GCM_OP_AUTHENTICATED_DECRYPTION
 };
 
-enum aesni_gcm_key {
-	AESNI_GCM_KEY_128,
-	AESNI_GCM_KEY_256
-};
-
 /** AESNI GCM private session structure */
 struct aesni_gcm_session {
 	enum aesni_gcm_operation op;
 	/**< GCM operation type */
 	enum aesni_gcm_key key;
 	/**< GCM key type */
-	struct gcm_data gdata __rte_cache_aligned;
-	/**< GCM parameters */
+	struct gcm_key_data gdata_key;
 };
 
 
 /**
  * Setup GCM session parameters
+ * @param	ops	gcm ops function pointer table
  * @param	sess	aesni gcm session structure
  * @param	xform	crypto transform chain
  *
@@ -109,7 +110,8 @@ struct aesni_gcm_session {
  * - On failure returns error code < 0
  */
 extern int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform);
 
 
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index bcaf1b3..d4ea8e7 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -147,7 +147,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore
 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -lrte_pmd_aesni_mb
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm -lisal_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -lrte_pmd_openssl -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)         += -lrte_pmd_qat -lcrypto
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 2/4] test/crypto: rename some tests
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
@ 2017-06-28 11:32   ` Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-06-28 11:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

AES-GCM tests are used for AES-NI MB, OpenSSL
and QAT PMDs, so they are not specific to the first one.
Therefore, _mb_ prefix can be removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 test/test/test_cryptodev.c | 268 ++++++++++++++++++++++-----------------------
 1 file changed, 134 insertions(+), 134 deletions(-)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index f8f15c0..d7da01f 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -5032,7 +5032,7 @@ create_gcm_operation(enum rte_crypto_cipher_operation op,
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
+test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
@@ -5114,103 +5114,103 @@ test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_1(void)
+test_AES_GCM_authenticated_encryption_test_case_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_1);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_2(void)
+test_AES_GCM_authenticated_encryption_test_case_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_3(void)
+test_AES_GCM_authenticated_encryption_test_case_3(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_3);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_3);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_4(void)
+test_AES_GCM_authenticated_encryption_test_case_4(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_4);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_4);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_5(void)
+test_AES_GCM_authenticated_encryption_test_case_5(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_5);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_5);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_6(void)
+test_AES_GCM_authenticated_encryption_test_case_6(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_6);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_6);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_7(void)
+test_AES_GCM_authenticated_encryption_test_case_7(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_7);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_7);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_1(void)
+test_AES_GCM_auth_encryption_test_case_256_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_2(void)
+test_AES_GCM_auth_encryption_test_case_256_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_2);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_3(void)
+test_AES_GCM_auth_encryption_test_case_256_3(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_3);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_3);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_4(void)
+test_AES_GCM_auth_encryption_test_case_256_4(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_4);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_4);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_5(void)
+test_AES_GCM_auth_encryption_test_case_256_5(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_5);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_5);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_6(void)
+test_AES_GCM_auth_encryption_test_case_256_6(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_6);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_6);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_7(void)
+test_AES_GCM_auth_encryption_test_case_256_7(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_7);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_7);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_aad_1(void)
+test_AES_GCM_auth_encryption_test_case_aad_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_aad_1);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_aad_2(void)
+test_AES_GCM_auth_encryption_test_case_aad_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_aad_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
+test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
@@ -5280,99 +5280,99 @@ test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_1(void)
+test_AES_GCM_authenticated_decryption_test_case_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_1);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_2(void)
+test_AES_GCM_authenticated_decryption_test_case_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_3(void)
+test_AES_GCM_authenticated_decryption_test_case_3(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_3);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_3);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_4(void)
+test_AES_GCM_authenticated_decryption_test_case_4(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_4);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_4);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_5(void)
+test_AES_GCM_authenticated_decryption_test_case_5(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_5);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_5);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_6(void)
+test_AES_GCM_authenticated_decryption_test_case_6(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_6);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_6);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_7(void)
+test_AES_GCM_authenticated_decryption_test_case_7(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_7);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_7);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_1(void)
+test_AES_GCM_auth_decryption_test_case_256_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_2(void)
+test_AES_GCM_auth_decryption_test_case_256_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_2);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_3(void)
+test_AES_GCM_auth_decryption_test_case_256_3(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_3);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_3);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_4(void)
+test_AES_GCM_auth_decryption_test_case_256_4(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_4);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_4);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_5(void)
+test_AES_GCM_auth_decryption_test_case_256_5(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_5);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_5);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_6(void)
+test_AES_GCM_auth_decryption_test_case_256_6(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_6);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_6);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_7(void)
+test_AES_GCM_auth_decryption_test_case_256_7(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_7);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_7);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_aad_1(void)
+test_AES_GCM_auth_decryption_test_case_aad_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_aad_1);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_aad_2(void)
+test_AES_GCM_auth_decryption_test_case_aad_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_aad_2);
 }
 
 static int
@@ -5447,7 +5447,7 @@ test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_oop(void)
+test_AES_GCM_authenticated_encryption_oop_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_encryption_oop(&gcm_test_case_5);
 }
@@ -5515,7 +5515,7 @@ test_AES_GCM_authenticated_decryption_oop(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_oop(void)
+test_AES_GCM_authenticated_decryption_oop_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_decryption_oop(&gcm_test_case_5);
 }
@@ -5595,7 +5595,7 @@ test_AES_GCM_authenticated_encryption_sessionless(
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_sessionless(void)
+test_AES_GCM_authenticated_encryption_sessionless_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_encryption_sessionless(
 			&gcm_test_case_5);
@@ -5667,7 +5667,7 @@ test_AES_GCM_authenticated_decryption_sessionless(
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_sessionless(void)
+test_AES_GCM_authenticated_decryption_sessionless_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_decryption_sessionless(
 			&gcm_test_case_5);
@@ -7962,35 +7962,35 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8165,35 +8165,35 @@ static struct unit_test_suite cryptodev_openssl_testsuite  = {
 
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8242,79 +8242,79 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 	.unit_test_cases = {
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_1),
+			test_AES_GCM_auth_encryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_2),
+			test_AES_GCM_auth_encryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_3),
+			test_AES_GCM_auth_encryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_4),
+			test_AES_GCM_auth_encryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_5),
+			test_AES_GCM_auth_encryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_6),
+			test_AES_GCM_auth_encryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_7),
+			test_AES_GCM_auth_encryption_test_case_256_7),
 
 		/** AES GCM Authenticated Decryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_1),
+			test_AES_GCM_auth_decryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_2),
+			test_AES_GCM_auth_decryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_3),
+			test_AES_GCM_auth_decryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_4),
+			test_AES_GCM_auth_decryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_5),
+			test_AES_GCM_auth_decryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_6),
+			test_AES_GCM_auth_decryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_7),
+			test_AES_GCM_auth_decryption_test_case_256_7),
 
 		/** AES GCM Authenticated Encryption big aad size */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_aad_1),
+			test_AES_GCM_auth_encryption_test_case_aad_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_aad_2),
+			test_AES_GCM_auth_encryption_test_case_aad_2),
 
 		/** AES GCM Authenticated Decryption big aad size */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_aad_1),
+			test_AES_GCM_auth_decryption_test_case_aad_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_aad_2),
+			test_AES_GCM_auth_decryption_test_case_aad_2),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8338,15 +8338,15 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 
 		/** Out of place tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_oop),
+			test_AES_GCM_authenticated_encryption_oop_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_oop),
+			test_AES_GCM_authenticated_decryption_oop_test_case_1),
 
 		/** Session-less tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_sessionless),
+			test_AES_GCM_authenticated_encryption_sessionless_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_sessionless),
+			test_AES_GCM_authenticated_decryption_sessionless_test_case_1),
 
 		/** Scatter-Gather */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 3/4] test/crypto: add AES GCM 192 tests
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 2/4] test/crypto: rename some tests Pablo de Lara
@ 2017-06-28 11:32   ` Pablo de Lara
  2017-06-28 11:32   ` [PATCH v2 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-06-28 11:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

Added AES GCM tests for 192-bit keys, now that AES GCM PMD
supports it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 test/test/test_cryptodev.c                  | 116 +++++++++
 test/test/test_cryptodev_gcm_test_vectors.h | 357 ++++++++++++++++++++++++++++
 2 files changed, 473 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index d7da01f..e0e8a6a 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -5156,6 +5156,48 @@ test_AES_GCM_authenticated_encryption_test_case_7(void)
 }
 
 static int
+test_AES_GCM_auth_encryption_test_case_192_1(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_1);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_2(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_2);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_3(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_3);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_4(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_4);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_5(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_5);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_6(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_6);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_7(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_7);
+}
+
+static int
 test_AES_GCM_auth_encryption_test_case_256_1(void)
 {
 	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
@@ -5322,6 +5364,48 @@ test_AES_GCM_authenticated_decryption_test_case_7(void)
 }
 
 static int
+test_AES_GCM_auth_decryption_test_case_192_1(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_1);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_2(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_2);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_3(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_3);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_4(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_4);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_5(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_5);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_6(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_6);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_7(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_7);
+}
+
+static int
 test_AES_GCM_auth_decryption_test_case_256_1(void)
 {
 	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
@@ -8272,6 +8356,38 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encryption_test_case_256_1),
diff --git a/test/test/test_cryptodev_gcm_test_vectors.h b/test/test/test_cryptodev_gcm_test_vectors.h
index 5764edb..22d6b72 100644
--- a/test/test/test_cryptodev_gcm_test_vectors.h
+++ b/test/test/test_cryptodev_gcm_test_vectors.h
@@ -1002,6 +1002,363 @@ static const struct gcm_test_data gcm_test_case_8 = {
 	}
 };
 
+/** AES-192 Test Vectors */
+static const struct gcm_test_data gcm_test_case_192_1 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.ciphertext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.auth_tag = {
+		.data = {
+			0xCD, 0x33, 0xB2, 0x8A, 0xC7, 0x73, 0xF7, 0x4B,
+			0xA0, 0x0E, 0xD1, 0xF3, 0x12, 0x57, 0x24, 0x35
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_2 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 16
+	},
+	.ciphertext = {
+		.data = {
+			0x98, 0xE7, 0x24, 0x7C, 0x07, 0xF0, 0xFE, 0x41,
+			0x1C, 0x26, 0x7E, 0x43, 0x84, 0xB0, 0xF6, 0x00
+		},
+		.len = 16
+	},
+	.auth_tag = {
+		.data = {
+			0x2F, 0xF5, 0x8D, 0x80, 0x03, 0x39, 0x27, 0xAB,
+			0x8E, 0xF4, 0xD4, 0x58, 0x75, 0x14, 0xF0, 0xFB
+
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_3 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39, 0x1A, 0xAF, 0xD2, 0x55
+		},
+		.len = 64
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10, 0xAC, 0xAD, 0xE2, 0x56
+		},
+		.len = 64
+	},
+	.auth_tag = {
+		.data = {
+			0x99, 0x24, 0xA7, 0xC8, 0x58, 0x73, 0x36, 0xBF,
+			0xB1, 0x18, 0x02, 0x4D, 0xB8, 0x67, 0x4A, 0x14
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_4 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0x57, 0x5F, 0x03, 0xA0, 0x8D, 0x8F, 0x40, 0x26,
+			0xE5, 0x64, 0x1F, 0x5B, 0x5C, 0xC2, 0xFD, 0x4B
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_5 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xB6, 0x35, 0x56, 0xE7, 0xBA, 0x46, 0xA3, 0x38,
+			0xED, 0xAD, 0x79, 0x9F, 0xB3, 0x5B, 0x34, 0xA8
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_6 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xCA, 0x8A, 0x8A, 0x91, 0x5A, 0xF9, 0x76, 0xE3,
+			0xFF, 0x2C, 0xE4, 0x7D, 0xE5, 0x62, 0x75, 0x18
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_7 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xC2, 0xD8, 0x4C, 0x6B, 0xA8, 0x3B, 0xA5, 0x6B,
+			0x18, 0x9F, 0xE6, 0xEF, 0x66, 0x24, 0xDD, 0xDA
+		},
+		.len = 16
+	}
+};
+
 /** AES-256 Test Vectors */
 static const struct gcm_test_data gcm_test_case_256_1 = {
 	.key = {
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
                     ` (2 preceding siblings ...)
  2017-06-28 11:32   ` [PATCH v2 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
@ 2017-06-28 11:32   ` Pablo de Lara
  2017-06-30 14:16   ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Sergio Gonzalez Monroy
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
  5 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-06-28 11:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

QAT and OpenSSL PMDs support 192-bit and 256-bit key sizes for AES-GCM,
apart from 128-bit keys. Therefore, these tests that were
only used by AES-NI MB PMD are extended to these other two PMDs.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 test/test/test_cryptodev.c | 113 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index e0e8a6a..1c0a773 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -8076,6 +8076,71 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
+		/** AES GCM Authenticated Encryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_7),
+
+		/** AES GCM Authenticated Decryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_7),
+
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_test_case_1),
@@ -8279,6 +8344,54 @@ static struct unit_test_suite cryptodev_openssl_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
+		/** AES GCM Authenticated Encryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_7),
+
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_test_case_1),
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
                     ` (3 preceding siblings ...)
  2017-06-28 11:32   ` [PATCH v2 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara
@ 2017-06-30 14:16   ` Sergio Gonzalez Monroy
  2017-07-04 10:11     ` De Lara Guarch, Pablo
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
  5 siblings, 1 reply; 17+ messages in thread
From: Sergio Gonzalez Monroy @ 2017-06-30 14:16 UTC (permalink / raw)
  To: Pablo de Lara, declan.doherty; +Cc: dev

On 28/06/2017 12:32, Pablo de Lara wrote:
> AES-NI GCM PMD migrated previously from Multi-buffer Crypto library to ISA-L Crypto library,
> to support several features that were not supported by that time, such as GMAC algorithm
> and Scatter-gather list.
>
> Since version 0.45, Multi-buffer library (https://github.com/01org/intel-ipsec-mb)
> supports all these features, the PMD can link against this library again (version 0.46 now).
>
> This will improve maintainability, as now AESNI GCM PMD will share the same library as
> AESNI MB PMD, having one less library to link against. It also adds support for 192-bit keys.
>
> In terms of performance, it has been improved, especially for some architectures.
>
> This patchset is migrating the PMD to link against Multi-buffer library v0.46.
>
> Changes in v2:
>
> - Supported Multi-buffer 0.46 library
> - Added new tests to other PMD testsuites
> - Rebased against latest dpdk-next-crypto code
>
> Pablo de Lara (4):
>    crypto/aesni_gcm: migrate to Multi-buffer library
>    test/crypto: rename some tests
>    test/crypto: add AES GCM 192 tests
>    test/crypto: extend AES-GCM 192/256 to other PMDs
>
>   devtools/test-build.sh                           |   4 +-
>   doc/guides/cryptodevs/aesni_gcm.rst              |  18 +-
>   doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
>   doc/guides/rel_notes/release_17_08.rst           |   8 +
>   drivers/crypto/aesni_gcm/Makefile                |   9 +-
>   drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 ++++-
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         |  98 +++--
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  18 +-
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  32 +-
>   mk/rte.app.mk                                    |   3 +-
>   test/test/test_cryptodev.c                       | 497 +++++++++++++++++------
>   test/test/test_cryptodev_gcm_test_vectors.h      | 357 ++++++++++++++++
>   12 files changed, 922 insertions(+), 223 deletions(-)
>

Series Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library
  2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
                     ` (4 preceding siblings ...)
  2017-06-30 14:16   ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Sergio Gonzalez Monroy
@ 2017-07-04  0:12   ` Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
                       ` (3 more replies)
  5 siblings, 4 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-07-04  0:12 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

This will improve maintainability, as now AESNI GCM PMD will share the same library
as AESNI MB PMD, having one less library to link against. It also adds support for 192-bit keys.

In terms of performance, it has been improved, especially for small packets.

This patchset is migrating the PMD to link against Multi-buffer library v0.46.

Changes in v3:

- Added extra documentation about external library version compatibility.
- Rebased against dpdk-next-crypto

Changes in v2:

- Supported Multi-buffer 0.46 library
- Added new tests to other PMD testsuites
- Rebased against latest dpdk-next-crypto code

Pablo de Lara (4):
  crypto/aesni_gcm: migrate to Multi-buffer library
  test/crypto: rename some tests
  test/crypto: add AES GCM 192 tests
  test/crypto: extend AES-GCM 192/256 to other PMDs

 devtools/test-build.sh                           |   4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              |  53 +-
 doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
 doc/guides/rel_notes/release_17_08.rst           |   8 +
 drivers/crypto/aesni_gcm/Makefile                |   9 +-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 +++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         | 111 +++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  14 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  28 +-
 mk/rte.app.mk                                    |   3 +-
 test/test/test_cryptodev.c                       | 585 ++++++++++++++++-------
 test/test/test_cryptodev_gcm_test_vectors.h      | 357 ++++++++++++++
 12 files changed, 1018 insertions(+), 255 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/4] crypto/aesni_gcm: migrate to Multi-buffer library
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
@ 2017-07-04  0:12     ` Pablo de Lara
  2017-07-04  9:43       ` Declan Doherty
  2017-07-04  0:12     ` [PATCH v3 2/4] test/crypto: rename some tests Pablo de Lara
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Pablo de Lara @ 2017-07-04  0:12 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara, Sergio Gonzalez Monroy

Since Intel Multi Buffer library for IPSec has been updated to
support Scatter Gather List, the AESNI GCM PMD can link
to this library, instead of the ISA-L library.

This move eases the maintenance of the driver, as it will
use the same library as the AESNI MB PMD.
It also adds support for 192-bit keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 devtools/test-build.sh                           |   4 +-
 doc/guides/cryptodevs/aesni_gcm.rst              |  53 ++++++++---
 doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
 doc/guides/rel_notes/release_17_08.rst           |   8 ++
 drivers/crypto/aesni_gcm/Makefile                |   9 +-
 drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 ++++++++++++++++++--
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         | 111 +++++++++++++----------
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  14 ++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  28 +++---
 mk/rte.app.mk                                    |   3 +-
 10 files changed, 238 insertions(+), 93 deletions(-)

diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 079c8b8..c6dfaf0 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -38,7 +38,6 @@ default_path=$PATH
 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
 # - DPDK_DEP_ARCHIVE
 # - DPDK_DEP_CFLAGS
-# - DPDK_DEP_ISAL_CRYPTO (y/[n])
 # - DPDK_DEP_LDFLAGS
 # - DPDK_DEP_MOFED (y/[n])
 # - DPDK_DEP_NUMA ([y]/n)
@@ -121,7 +120,6 @@ reset_env ()
 	unset CROSS
 	unset DPDK_DEP_ARCHIVE
 	unset DPDK_DEP_CFLAGS
-	unset DPDK_DEP_ISAL_CRYPTO
 	unset DPDK_DEP_LDFLAGS
 	unset DPDK_DEP_MOFED
 	unset DPDK_DEP_NUMA
@@ -182,7 +180,7 @@ config () # <directory> <target> <options>
 		sed -ri   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
 		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
-		test "$DPDK_DEP_ISAL_CRYPTO" != y || \
+		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
 		sed -ri      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
 		test -z "$LIBSSO_SNOW3G_PATH" || \
 		sed -ri         's,(PMD_SNOW3G=)n,\1y,' $1/.config
diff --git a/doc/guides/cryptodevs/aesni_gcm.rst b/doc/guides/cryptodevs/aesni_gcm.rst
index 84cdc52..591c0b1 100644
--- a/doc/guides/cryptodevs/aesni_gcm.rst
+++ b/doc/guides/cryptodevs/aesni_gcm.rst
@@ -1,5 +1,5 @@
 ..  BSD LICENSE
-    Copyright(c) 2016 Intel Corporation. All rights reserved.
+    Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
@@ -32,8 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
 
 
 The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode crypto driver
-support for utilizing Intel ISA-L crypto library, which provides operation acceleration
-through the AES-NI instruction sets for AES-GCM authenticated cipher algorithm.
+support for utilizing Intel multi buffer library (see AES-NI Multi-buffer PMD documentation
+to learn more about it, including installation).
 
 Features
 --------
@@ -49,19 +49,51 @@ Authentication algorithms:
 * RTE_CRYPTO_AUTH_AES_GCM
 * RTE_CRYPTO_AUTH_AES_GMAC
 
+Limitations
+-----------
+
+* Chained mbufs are supported but only out-of-place (destination mbuf must be contiguous).
+* Cipher only is not supported.
+
+
 Installation
 ------------
 
-To build DPDK with the AESNI_GCM_PMD the user is required to install
-the ``libisal_crypto`` library in the build environment.
-For download and more details please visit `<https://github.com/01org/isa-l_crypto>`_.
+To build DPDK with the AESNI_GCM_PMD the user is required to download the multi-buffer
+library from `here <https://github.com/01org/intel-ipsec-mb>`_
+and compile it on their user system before building DPDK.
+The latest version of the library supported by this PMD is v0.46, which
+can be downloaded in `<https://github.com/01org/intel-ipsec-mb/archive/v0.46.zip>`_.
+
+.. code-block:: console
+
+	make
+
+As a reference, the following table shows a mapping between the past DPDK versions
+and the external crypto libraries supported by them:
+
+.. _table_aesni_mb_versions:
+
+.. table:: DPDK and external crypto library version compatibility
+
+   =============  ================================
+   DPDK version   Crypto library version
+   =============  ================================
+   16.04 - 16.11  Multi-buffer library 0.43 - 0.44
+   17.02 - 17.05  ISA-L Crypto v2.18
+   17.08+         Multi-buffer library 0.46+
+   =============  ================================
+
 
 Initialization
 --------------
 
 In order to enable this virtual crypto PMD, user must:
 
-* Install the ISA-L crypto library (explained in Installation section).
+* Export the environmental variable AESNI_MULTI_BUFFER_LIB_PATH with the path where
+  the library was extracted.
+
+* Build the multi buffer library (explained in Installation section).
 
 * Set CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=y in config/common_base.
 
@@ -85,10 +117,3 @@ Example:
 .. code-block:: console
 
     ./l2fwd-crypto -l 6 -n 4 --vdev="crypto_aesni_gcm,socket_id=1,max_nb_sessions=128"
-
-Limitations
------------
-
-* Chained mbufs are supported but only out-of-place (destination mbuf must be contiguous).
-* Hash only is not supported.
-* Cipher only is not supported.
diff --git a/doc/guides/cryptodevs/features/aesni_gcm.ini b/doc/guides/cryptodevs/features/aesni_gcm.ini
index 5d9e119..0f11fef 100644
--- a/doc/guides/cryptodevs/features/aesni_gcm.ini
+++ b/doc/guides/cryptodevs/features/aesni_gcm.ini
@@ -7,7 +7,9 @@
 Symmetric crypto       = Y
 Sym operation chaining = Y
 CPU AESNI              = Y
-
+CPU SSE                = Y
+CPU AVX                = Y
+CPU AVX2               = Y
 ;
 ; Supported crypto algorithms of the 'aesni_gcm' crypto driver.
 ;
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index 964aa93..515252b 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -91,6 +91,14 @@ New Features
 
     * 12-byte IV on AES Counter Mode, apart from the previous 16-byte IV.
 
+**Updated the AES-NI GCM PMD.**
+
+  The AES-NI GCM PMD was migrated from the ISA-L library to the Multi Buffer
+  library, as the latter library has Scatter Gather List support
+  now. The migration entailed adding additional support for:
+
+  * 192-bit key.
+
 
 Resolved Issues
 ---------------
diff --git a/drivers/crypto/aesni_gcm/Makefile b/drivers/crypto/aesni_gcm/Makefile
index 59a7c6a..6fca5e1 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2016 Intel Corporation. All rights reserved.
+#   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
 #   modification, are permitted provided that the following conditions
@@ -31,6 +31,9 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 ifneq ($(MAKECMDGOALS),clean)
+ifeq ($(AESNI_MULTI_BUFFER_LIB_PATH),)
+$(error "Please define AESNI_MULTI_BUFFER_LIB_PATH environment variable")
+endif
 endif
 
 # library name
@@ -47,7 +50,9 @@ LIBABIVER := 1
 EXPORT_MAP := rte_pmd_aesni_gcm_version.map
 
 # external library dependencies
-LDLIBS += -lisal_crypto
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)
+CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
+LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm_pmd.c
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
index e9de654..d6a18ef 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_ops.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -37,26 +37,109 @@
 #define LINUX
 #endif
 
-#include <isa-l_crypto/aes_gcm.h>
+#include <gcm_defines.h>
+#include <aux_funcs.h>
 
-typedef void (*aesni_gcm_init_t)(struct gcm_data *my_ctx_data,
-		uint8_t *iv,
+/** Supported vector modes */
+enum aesni_gcm_vector_mode {
+	RTE_AESNI_GCM_NOT_SUPPORTED = 0,
+	RTE_AESNI_GCM_SSE,
+	RTE_AESNI_GCM_AVX,
+	RTE_AESNI_GCM_AVX2,
+	RTE_AESNI_GCM_VECTOR_NUM
+};
+
+enum aesni_gcm_key {
+	AESNI_GCM_KEY_128,
+	AESNI_GCM_KEY_192,
+	AESNI_GCM_KEY_256,
+	AESNI_GCM_KEY_NUM
+};
+
+
+typedef void (*aesni_gcm_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data, uint8_t *out,
+		const uint8_t *in, uint64_t plaintext_len, const uint8_t *iv,
+		const uint8_t *aad, uint64_t aad_len,
+		uint8_t *auth_tag, uint64_t auth_tag_len);
+
+typedef void (*aesni_gcm_precomp_t)(const void *key, struct gcm_key_data *gcm_data);
+
+typedef void (*aesni_gcm_init_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
+		const uint8_t *iv,
 		uint8_t const *aad,
 		uint64_t aad_len);
 
-typedef void (*aesni_gcm_update_t)(struct gcm_data *my_ctx_data,
+typedef void (*aesni_gcm_update_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
 		uint8_t *out,
 		const uint8_t *in,
 		uint64_t plaintext_len);
 
-typedef void (*aesni_gcm_finalize_t)(struct gcm_data *my_ctx_data,
+typedef void (*aesni_gcm_finalize_t)(const struct gcm_key_data *gcm_key_data,
+		struct gcm_context_data *gcm_ctx_data,
 		uint8_t *auth_tag,
 		uint64_t auth_tag_len);
 
+/** GCM library function pointer table */
 struct aesni_gcm_ops {
+	aesni_gcm_t enc;        /**< GCM encode function pointer */
+	aesni_gcm_t dec;        /**< GCM decode function pointer */
+	aesni_gcm_precomp_t precomp;    /**< GCM pre-compute */
 	aesni_gcm_init_t init;
-	aesni_gcm_update_t update;
+	aesni_gcm_update_t update_enc;
+	aesni_gcm_update_t update_dec;
 	aesni_gcm_finalize_t finalize;
 };
 
+#define AES_GCM_FN(keylen, arch) \
+aes_gcm_enc_##keylen##_##arch,\
+aes_gcm_dec_##keylen##_##arch,\
+aes_gcm_pre_##keylen##_##arch,\
+aes_gcm_init_##keylen##_##arch,\
+aes_gcm_enc_##keylen##_update_##arch,\
+aes_gcm_dec_##keylen##_update_##arch,\
+aes_gcm_enc_##keylen##_finalize_##arch,
+
+static const struct aesni_gcm_ops gcm_ops[RTE_AESNI_GCM_VECTOR_NUM][AESNI_GCM_KEY_NUM] = {
+	[RTE_AESNI_GCM_NOT_SUPPORTED] = {
+		[AESNI_GCM_KEY_128] = {NULL},
+		[AESNI_GCM_KEY_192] = {NULL},
+		[AESNI_GCM_KEY_256] = {NULL}
+	},
+	[RTE_AESNI_GCM_SSE] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, sse)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, sse)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, sse)
+		}
+	},
+	[RTE_AESNI_GCM_AVX] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, avx_gen2)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, avx_gen2)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, avx_gen2)
+		}
+	},
+	[RTE_AESNI_GCM_AVX2] = {
+		[AESNI_GCM_KEY_128] = {
+			AES_GCM_FN(128, avx_gen4)
+		},
+		[AESNI_GCM_KEY_192] = {
+			AES_GCM_FN(192, avx_gen4)
+		},
+		[AESNI_GCM_KEY_256] = {
+			AES_GCM_FN(256, avx_gen4)
+		}
+	}
+};
 #endif /* _AESNI_GCM_OPS_H_ */
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 9903182..b2a4ba5 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -43,37 +43,11 @@
 
 #include "aesni_gcm_pmd_private.h"
 
-/** GCM encode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_enc[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_enc_update,
-				aesni_gcm128_enc_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_enc_update,
-				aesni_gcm256_enc_finalize
-		}
-};
-
-/** GCM decode functions pointer table */
-static const struct aesni_gcm_ops aesni_gcm_dec[] = {
-		[AESNI_GCM_KEY_128] = {
-				aesni_gcm128_init,
-				aesni_gcm128_dec_update,
-				aesni_gcm128_dec_finalize
-		},
-		[AESNI_GCM_KEY_256] = {
-				aesni_gcm256_init,
-				aesni_gcm256_dec_update,
-				aesni_gcm256_dec_finalize
-		}
-};
 
 /** Parse crypto xform chain and set private session parameters */
 int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *gcm_ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform)
 {
 	const struct rte_crypto_sym_xform *auth_xform;
@@ -145,20 +119,21 @@ aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
 	/* Check key length and calculate GCM pre-compute. */
 	switch (key_length) {
 	case 16:
-		aesni_gcm128_pre(key, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_128;
-
+		break;
+	case 24:
+		sess->key = AESNI_GCM_KEY_192;
 		break;
 	case 32:
-		aesni_gcm256_pre(key, &sess->gdata);
 		sess->key = AESNI_GCM_KEY_256;
-
 		break;
 	default:
 		GCM_LOG_ERR("Unsupported key length");
 		return -EINVAL;
 	}
 
+	gcm_ops[sess->key].precomp(key, &sess->gdata_key);
+
 	/* Digest check */
 	if (digest_length != 16 &&
 			digest_length != 12 &&
@@ -193,7 +168,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_op *op)
 		sess = (struct aesni_gcm_session *)
 			((struct rte_cryptodev_sym_session *)_sess)->_private;
 
-		if (unlikely(aesni_gcm_set_session_parameters(sess,
+		if (unlikely(aesni_gcm_set_session_parameters(qp->ops, sess,
 				sym_op->xform) != 0)) {
 			rte_mempool_put(qp->sess_mp, _sess);
 			sess = NULL;
@@ -214,7 +189,7 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp, struct rte_crypto_op *op)
  *
  */
 static int
-process_gcm_crypto_op(struct rte_crypto_op *op,
+process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct rte_crypto_op *op,
 		struct aesni_gcm_session *session)
 {
 	uint8_t *src, *dst;
@@ -279,12 +254,14 @@ process_gcm_crypto_op(struct rte_crypto_op *op,
 
 	if (session->op == AESNI_GCM_OP_AUTHENTICATED_ENCRYPTION) {
 
-		aesni_gcm_enc[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				iv_ptr,
 				sym_op->aead.aad.data,
 				(uint64_t)session->aad_length);
 
-		aesni_gcm_enc[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_enc(&session->gdata_key,
+				&qp->gdata_ctx, dst, src,
 				(uint64_t)part_len);
 		total_len = data_length - part_len;
 
@@ -298,13 +275,14 @@ process_gcm_crypto_op(struct rte_crypto_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_enc[session->key].update(&session->gdata,
-					dst, src,
+			qp->ops[session->key].update_enc(&session->gdata_key,
+					&qp->gdata_ctx, dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_enc[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				sym_op->aead.digest.data,
 				(uint64_t)session->digest_length);
 	} else if (session->op == AESNI_GCM_OP_AUTHENTICATED_DECRYPTION) {
@@ -317,12 +295,14 @@ process_gcm_crypto_op(struct rte_crypto_op *op,
 			return -1;
 		}
 
-		aesni_gcm_dec[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				iv_ptr,
 				sym_op->aead.aad.data,
 				(uint64_t)session->aad_length);
 
-		aesni_gcm_dec[session->key].update(&session->gdata, dst, src,
+		qp->ops[session->key].update_dec(&session->gdata_key,
+				&qp->gdata_ctx, dst, src,
 				(uint64_t)part_len);
 		total_len = data_length - part_len;
 
@@ -336,21 +316,25 @@ process_gcm_crypto_op(struct rte_crypto_op *op,
 			part_len = (m_src->data_len < total_len) ?
 					m_src->data_len : total_len;
 
-			aesni_gcm_dec[session->key].update(&session->gdata,
+			qp->ops[session->key].update_dec(&session->gdata_key,
+					&qp->gdata_ctx,
 					dst, src,
 					(uint64_t)part_len);
 			total_len -= part_len;
 		}
 
-		aesni_gcm_dec[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				auth_tag,
 				(uint64_t)session->digest_length);
 	} else if (session->op == AESNI_GMAC_OP_GENERATE) {
-		aesni_gcm_enc[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				iv_ptr,
 				src,
 				(uint64_t)data_length);
-		aesni_gcm_enc[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				sym_op->auth.digest.data,
 				(uint64_t)session->digest_length);
 	} else { /* AESNI_GMAC_OP_VERIFY */
@@ -363,12 +347,14 @@ process_gcm_crypto_op(struct rte_crypto_op *op,
 			return -1;
 		}
 
-		aesni_gcm_dec[session->key].init(&session->gdata,
+		qp->ops[session->key].init(&session->gdata_key,
+				&qp->gdata_ctx,
 				iv_ptr,
 				src,
 				(uint64_t)data_length);
 
-		aesni_gcm_dec[session->key].finalize(&session->gdata,
+		qp->ops[session->key].finalize(&session->gdata_key,
+				&qp->gdata_ctx,
 				auth_tag,
 				(uint64_t)session->digest_length);
 	}
@@ -468,7 +454,7 @@ aesni_gcm_pmd_dequeue_burst(void *queue_pair,
 			break;
 		}
 
-		retval = process_gcm_crypto_op(ops[i], sess);
+		retval = process_gcm_crypto_op(qp, ops[i], sess);
 		if (retval < 0) {
 			ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
 			qp->qp_stats.dequeue_err_count++;
@@ -507,6 +493,7 @@ aesni_gcm_create(const char *name,
 {
 	struct rte_cryptodev *dev;
 	struct aesni_gcm_private *internals;
+	enum aesni_gcm_vector_mode vector_mode;
 
 	if (init_params->name[0] == '\0')
 		snprintf(init_params->name, sizeof(init_params->name),
@@ -518,6 +505,18 @@ aesni_gcm_create(const char *name,
 		return -EFAULT;
 	}
 
+	/* Check CPU for supported vector instruction set */
+	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
+		vector_mode = RTE_AESNI_GCM_AVX2;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
+		vector_mode = RTE_AESNI_GCM_AVX;
+	else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
+		vector_mode = RTE_AESNI_GCM_SSE;
+	else {
+		GCM_LOG_ERR("Vector instructions are not supported by CPU");
+		return -EFAULT;
+	}
+
 	dev = rte_cryptodev_vdev_pmd_init(init_params->name,
 			sizeof(struct aesni_gcm_private), init_params->socket_id,
 			vdev);
@@ -538,8 +537,24 @@ aesni_gcm_create(const char *name,
 			RTE_CRYPTODEV_FF_CPU_AESNI |
 			RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER;
 
+	switch (vector_mode) {
+	case RTE_AESNI_GCM_SSE:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
+		break;
+	case RTE_AESNI_GCM_AVX:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
+		break;
+	case RTE_AESNI_GCM_AVX2:
+		dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;
+		break;
+	default:
+		break;
+	}
+
 	internals = dev->data->dev_private;
 
+	internals->vector_mode = vector_mode;
+
 	internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
 	internals->max_nb_sessions = init_params->max_nb_sessions;
 
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 4eedaa3..ddc4c30 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -49,7 +49,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -75,7 +75,7 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 				.key_size = {
 					.min = 16,
 					.max = 32,
-					.increment = 16
+					.increment = 8
 				},
 				.digest_size = {
 					.min = 8,
@@ -233,6 +233,7 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		 int socket_id)
 {
 	struct aesni_gcm_qp *qp = NULL;
+	struct aesni_gcm_private *internals = dev->data->dev_private;
 
 	/* Free memory prior to re-allocation if needed. */
 	if (dev->data->queue_pairs[qp_id] != NULL)
@@ -250,6 +251,8 @@ aesni_gcm_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	if (aesni_gcm_pmd_qp_set_unique_name(dev, qp))
 		goto qp_setup_cleanup;
 
+	qp->ops = (const struct aesni_gcm_ops *)gcm_ops[internals->vector_mode];
+
 	qp->processed_pkts = aesni_gcm_pmd_qp_create_processed_pkts_ring(qp,
 			qp_conf->nb_descriptors, socket_id);
 	if (qp->processed_pkts == NULL)
@@ -300,15 +303,18 @@ aesni_gcm_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 
 /** Configure a aesni gcm session from a crypto xform chain */
 static void *
-aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,
+aesni_gcm_pmd_session_configure(struct rte_cryptodev *dev,
 		struct rte_crypto_sym_xform *xform,	void *sess)
 {
+	struct aesni_gcm_private *internals = dev->data->dev_private;
+
 	if (unlikely(sess == NULL)) {
 		GCM_LOG_ERR("invalid session struct");
 		return NULL;
 	}
 
-	if (aesni_gcm_set_session_parameters(sess, xform) != 0) {
+	if (aesni_gcm_set_session_parameters(gcm_ops[internals->vector_mode],
+			sess, xform) != 0) {
 		GCM_LOG_ERR("failed configure session parameters");
 		return NULL;
 	}
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
index fea5fbe..4885188 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
@@ -58,6 +58,8 @@
 
 /** private data structure for each virtual AESNI GCM device */
 struct aesni_gcm_private {
+	enum aesni_gcm_vector_mode vector_mode;
+	/**< Vector mode */
 	unsigned max_nb_queue_pairs;
 	/**< Max number of queue pairs supported by device */
 	unsigned max_nb_sessions;
@@ -65,16 +67,20 @@ struct aesni_gcm_private {
 };
 
 struct aesni_gcm_qp {
-	uint16_t id;
-	/**< Queue Pair Identifier */
-	char name[RTE_CRYPTODEV_NAME_LEN];
-	/**< Unique Queue Pair Name */
+	const struct aesni_gcm_ops *ops;
+	/**< Architecture dependent function pointer table of the gcm APIs */
 	struct rte_ring *processed_pkts;
 	/**< Ring for placing process packets */
+	struct gcm_context_data gdata_ctx; /* (16 * 5) + 8 = 88 B */
+	/**< GCM parameters */
+	struct rte_cryptodev_stats qp_stats; /* 8 * 4 = 32 B */
+	/**< Queue pair statistics */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
-	/**< Queue pair statistics */
+	uint16_t id;
+	/**< Queue Pair Identifier */
+	char name[RTE_CRYPTODEV_NAME_LEN];
+	/**< Unique Queue Pair Name */
 } __rte_cache_aligned;
 
 
@@ -85,11 +91,6 @@ enum aesni_gcm_operation {
 	AESNI_GMAC_OP_VERIFY
 };
 
-enum aesni_gcm_key {
-	AESNI_GCM_KEY_128,
-	AESNI_GCM_KEY_256
-};
-
 /** AESNI GCM private session structure */
 struct aesni_gcm_session {
 	struct {
@@ -105,7 +106,7 @@ struct aesni_gcm_session {
 	/**< GCM operation type */
 	enum aesni_gcm_key key;
 	/**< GCM key type */
-	struct gcm_data gdata __rte_cache_aligned;
+	struct gcm_key_data gdata_key;
 	/**< GCM parameters */
 };
 
@@ -120,7 +121,8 @@ struct aesni_gcm_session {
  * - On failure returns error code < 0
  */
 extern int
-aesni_gcm_set_session_parameters(struct aesni_gcm_session *sess,
+aesni_gcm_set_session_parameters(const struct aesni_gcm_ops *ops,
+		struct aesni_gcm_session *sess,
 		const struct rte_crypto_sym_xform *xform);
 
 
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 7d71a49..4014063 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -147,7 +147,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore
 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -lrte_pmd_aesni_mb
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB)    += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm -lisal_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -lrte_pmd_openssl -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)         += -lrte_pmd_qat -lcrypto
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 2/4] test/crypto: rename some tests
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
@ 2017-07-04  0:12     ` Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara
  3 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-07-04  0:12 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

AES-GCM tests are used for AES-NI MB, OpenSSL,
QAT and DPAA2_SEC PMDs, so they are not specific to the first one.
Therefore, _mb_ prefix can be removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 test/test/test_cryptodev.c | 324 ++++++++++++++++++++++-----------------------
 1 file changed, 162 insertions(+), 162 deletions(-)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index fe6c8dd..7a05d56 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -4830,7 +4830,7 @@ create_gcm_operation(enum rte_crypto_aead_operation op,
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
+test_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
@@ -4912,103 +4912,103 @@ test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_1(void)
+test_AES_GCM_authenticated_encryption_test_case_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_1);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_2(void)
+test_AES_GCM_authenticated_encryption_test_case_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_3(void)
+test_AES_GCM_authenticated_encryption_test_case_3(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_3);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_3);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_4(void)
+test_AES_GCM_authenticated_encryption_test_case_4(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_4);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_4);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_5(void)
+test_AES_GCM_authenticated_encryption_test_case_5(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_5);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_5);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_6(void)
+test_AES_GCM_authenticated_encryption_test_case_6(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_6);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_6);
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_test_case_7(void)
+test_AES_GCM_authenticated_encryption_test_case_7(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_7);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_7);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_1(void)
+test_AES_GCM_auth_encryption_test_case_256_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_2(void)
+test_AES_GCM_auth_encryption_test_case_256_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_2);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_3(void)
+test_AES_GCM_auth_encryption_test_case_256_3(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_3);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_3);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_4(void)
+test_AES_GCM_auth_encryption_test_case_256_4(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_4);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_4);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_5(void)
+test_AES_GCM_auth_encryption_test_case_256_5(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_5);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_5);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_6(void)
+test_AES_GCM_auth_encryption_test_case_256_6(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_6);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_6);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_256_7(void)
+test_AES_GCM_auth_encryption_test_case_256_7(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_256_7);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_7);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_aad_1(void)
+test_AES_GCM_auth_encryption_test_case_aad_1(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_1);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_aad_1);
 }
 
 static int
-test_mb_AES_GCM_auth_encryption_test_case_aad_2(void)
+test_AES_GCM_auth_encryption_test_case_aad_2(void)
 {
-	return test_mb_AES_GCM_authenticated_encryption(&gcm_test_case_aad_2);
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_aad_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
+test_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
@@ -5078,99 +5078,99 @@ test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_1(void)
+test_AES_GCM_authenticated_decryption_test_case_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_1);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_2(void)
+test_AES_GCM_authenticated_decryption_test_case_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_2);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_3(void)
+test_AES_GCM_authenticated_decryption_test_case_3(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_3);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_3);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_4(void)
+test_AES_GCM_authenticated_decryption_test_case_4(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_4);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_4);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_5(void)
+test_AES_GCM_authenticated_decryption_test_case_5(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_5);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_5);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_6(void)
+test_AES_GCM_authenticated_decryption_test_case_6(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_6);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_6);
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_test_case_7(void)
+test_AES_GCM_authenticated_decryption_test_case_7(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_7);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_7);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_1(void)
+test_AES_GCM_auth_decryption_test_case_256_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_2(void)
+test_AES_GCM_auth_decryption_test_case_256_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_2);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_3(void)
+test_AES_GCM_auth_decryption_test_case_256_3(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_3);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_3);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_4(void)
+test_AES_GCM_auth_decryption_test_case_256_4(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_4);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_4);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_5(void)
+test_AES_GCM_auth_decryption_test_case_256_5(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_5);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_5);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_6(void)
+test_AES_GCM_auth_decryption_test_case_256_6(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_6);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_6);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_256_7(void)
+test_AES_GCM_auth_decryption_test_case_256_7(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_256_7);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_7);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_aad_1(void)
+test_AES_GCM_auth_decryption_test_case_aad_1(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_1);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_aad_1);
 }
 
 static int
-test_mb_AES_GCM_auth_decryption_test_case_aad_2(void)
+test_AES_GCM_auth_decryption_test_case_aad_2(void)
 {
-	return test_mb_AES_GCM_authenticated_decryption(&gcm_test_case_aad_2);
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_aad_2);
 }
 
 static int
@@ -5245,7 +5245,7 @@ test_AES_GCM_authenticated_encryption_oop(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_oop(void)
+test_AES_GCM_authenticated_encryption_oop_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_encryption_oop(&gcm_test_case_5);
 }
@@ -5313,7 +5313,7 @@ test_AES_GCM_authenticated_decryption_oop(const struct gcm_test_data *tdata)
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_oop(void)
+test_AES_GCM_authenticated_decryption_oop_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_decryption_oop(&gcm_test_case_5);
 }
@@ -5393,7 +5393,7 @@ test_AES_GCM_authenticated_encryption_sessionless(
 }
 
 static int
-test_mb_AES_GCM_authenticated_encryption_sessionless(void)
+test_AES_GCM_authenticated_encryption_sessionless_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_encryption_sessionless(
 			&gcm_test_case_5);
@@ -5465,7 +5465,7 @@ test_AES_GCM_authenticated_decryption_sessionless(
 }
 
 static int
-test_mb_AES_GCM_authenticated_decryption_sessionless(void)
+test_AES_GCM_authenticated_decryption_sessionless_test_case_1(void)
 {
 	return test_AES_GCM_authenticated_decryption_sessionless(
 			&gcm_test_case_5);
@@ -7722,35 +7722,35 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -7925,35 +7925,35 @@ static struct unit_test_suite cryptodev_openssl_testsuite  = {
 
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8002,79 +8002,79 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 	.unit_test_cases = {
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_1),
+			test_AES_GCM_auth_encryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_2),
+			test_AES_GCM_auth_encryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_3),
+			test_AES_GCM_auth_encryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_4),
+			test_AES_GCM_auth_encryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_5),
+			test_AES_GCM_auth_encryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_6),
+			test_AES_GCM_auth_encryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_7),
+			test_AES_GCM_auth_encryption_test_case_256_7),
 
 		/** AES GCM Authenticated Decryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_1),
+			test_AES_GCM_auth_decryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_2),
+			test_AES_GCM_auth_decryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_3),
+			test_AES_GCM_auth_decryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_4),
+			test_AES_GCM_auth_decryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_5),
+			test_AES_GCM_auth_decryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_6),
+			test_AES_GCM_auth_decryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_7),
+			test_AES_GCM_auth_decryption_test_case_256_7),
 
 		/** AES GCM Authenticated Encryption big aad size */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_aad_1),
+			test_AES_GCM_auth_encryption_test_case_aad_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_aad_2),
+			test_AES_GCM_auth_encryption_test_case_aad_2),
 
 		/** AES GCM Authenticated Decryption big aad size */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_aad_1),
+			test_AES_GCM_auth_decryption_test_case_aad_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_aad_2),
+			test_AES_GCM_auth_decryption_test_case_aad_2),
 
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8098,15 +8098,15 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 
 		/** Out of place tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_oop),
+			test_AES_GCM_authenticated_encryption_oop_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_oop),
+			test_AES_GCM_authenticated_decryption_oop_test_case_1),
 
 		/** Session-less tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_sessionless),
+			test_AES_GCM_authenticated_encryption_sessionless_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_sessionless),
+			test_AES_GCM_authenticated_decryption_sessionless_test_case_1),
 
 		/** Scatter-Gather */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -8313,67 +8313,67 @@ static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
 
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_1),
+			test_AES_GCM_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_2),
+			test_AES_GCM_authenticated_encryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_3),
+			test_AES_GCM_authenticated_encryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_4),
+			test_AES_GCM_authenticated_encryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_5),
+			test_AES_GCM_authenticated_encryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_6),
+			test_AES_GCM_authenticated_encryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_encryption_test_case_7),
+			test_AES_GCM_authenticated_encryption_test_case_7),
 
 		/** AES GCM Authenticated Decryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_1),
+			test_AES_GCM_authenticated_decryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_2),
+			test_AES_GCM_authenticated_decryption_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_3),
+			test_AES_GCM_authenticated_decryption_test_case_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_4),
+			test_AES_GCM_authenticated_decryption_test_case_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_5),
+			test_AES_GCM_authenticated_decryption_test_case_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_6),
+			test_AES_GCM_authenticated_decryption_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_authenticated_decryption_test_case_7),
+			test_AES_GCM_authenticated_decryption_test_case_7),
 
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_1),
+			test_AES_GCM_auth_encryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_2),
+			test_AES_GCM_auth_encryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_3),
+			test_AES_GCM_auth_encryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_4),
+			test_AES_GCM_auth_encryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_5),
+			test_AES_GCM_auth_encryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_6),
+			test_AES_GCM_auth_encryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_encryption_test_case_256_7),
+			test_AES_GCM_auth_encryption_test_case_256_7),
 
 		/** AES GCM Authenticated Decryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_1),
+			test_AES_GCM_auth_decryption_test_case_256_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_2),
+			test_AES_GCM_auth_decryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_3),
+			test_AES_GCM_auth_decryption_test_case_256_3),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_4),
+			test_AES_GCM_auth_decryption_test_case_256_4),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_5),
+			test_AES_GCM_auth_decryption_test_case_256_5),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_6),
+			test_AES_GCM_auth_decryption_test_case_256_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_mb_AES_GCM_auth_decryption_test_case_256_7),
+			test_AES_GCM_auth_decryption_test_case_256_7),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 3/4] test/crypto: add AES GCM 192 tests
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 2/4] test/crypto: rename some tests Pablo de Lara
@ 2017-07-04  0:12     ` Pablo de Lara
  2017-07-04  0:12     ` [PATCH v3 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara
  3 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-07-04  0:12 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

Added AES GCM tests for 192-bit keys, now that AES GCM PMD
supports it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 test/test/test_cryptodev.c                  | 116 +++++++++
 test/test/test_cryptodev_gcm_test_vectors.h | 357 ++++++++++++++++++++++++++++
 2 files changed, 473 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 7a05d56..e71736f 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -4954,6 +4954,48 @@ test_AES_GCM_authenticated_encryption_test_case_7(void)
 }
 
 static int
+test_AES_GCM_auth_encryption_test_case_192_1(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_1);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_2(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_2);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_3(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_3);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_4(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_4);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_5(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_5);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_6(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_6);
+}
+
+static int
+test_AES_GCM_auth_encryption_test_case_192_7(void)
+{
+	return test_AES_GCM_authenticated_encryption(&gcm_test_case_192_7);
+}
+
+static int
 test_AES_GCM_auth_encryption_test_case_256_1(void)
 {
 	return test_AES_GCM_authenticated_encryption(&gcm_test_case_256_1);
@@ -5120,6 +5162,48 @@ test_AES_GCM_authenticated_decryption_test_case_7(void)
 }
 
 static int
+test_AES_GCM_auth_decryption_test_case_192_1(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_1);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_2(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_2);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_3(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_3);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_4(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_4);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_5(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_5);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_6(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_6);
+}
+
+static int
+test_AES_GCM_auth_decryption_test_case_192_7(void)
+{
+	return test_AES_GCM_authenticated_decryption(&gcm_test_case_192_7);
+}
+
+static int
 test_AES_GCM_auth_decryption_test_case_256_1(void)
 {
 	return test_AES_GCM_authenticated_decryption(&gcm_test_case_256_1);
@@ -8032,6 +8116,38 @@ static struct unit_test_suite cryptodev_aesni_gcm_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encryption_test_case_256_1),
diff --git a/test/test/test_cryptodev_gcm_test_vectors.h b/test/test/test_cryptodev_gcm_test_vectors.h
index ac4b0d4..7879c35 100644
--- a/test/test/test_cryptodev_gcm_test_vectors.h
+++ b/test/test/test_cryptodev_gcm_test_vectors.h
@@ -997,6 +997,363 @@ static const struct gcm_test_data gcm_test_case_8 = {
 	}
 };
 
+/** AES-192 Test Vectors */
+static const struct gcm_test_data gcm_test_case_192_1 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.ciphertext = {
+		.data = { 0x00 },
+		.len = 0
+	},
+	.auth_tag = {
+		.data = {
+			0xCD, 0x33, 0xB2, 0x8A, 0xC7, 0x73, 0xF7, 0x4B,
+			0xA0, 0x0E, 0xD1, 0xF3, 0x12, 0x57, 0x24, 0x35
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_2 = {
+	.key = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+		},
+		.len = 16
+	},
+	.ciphertext = {
+		.data = {
+			0x98, 0xE7, 0x24, 0x7C, 0x07, 0xF0, 0xFE, 0x41,
+			0x1C, 0x26, 0x7E, 0x43, 0x84, 0xB0, 0xF6, 0x00
+		},
+		.len = 16
+	},
+	.auth_tag = {
+		.data = {
+			0x2F, 0xF5, 0x8D, 0x80, 0x03, 0x39, 0x27, 0xAB,
+			0x8E, 0xF4, 0xD4, 0x58, 0x75, 0x14, 0xF0, 0xFB
+
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_3 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 0
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39, 0x1A, 0xAF, 0xD2, 0x55
+		},
+		.len = 64
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10, 0xAC, 0xAD, 0xE2, 0x56
+		},
+		.len = 64
+	},
+	.auth_tag = {
+		.data = {
+			0x99, 0x24, 0xA7, 0xC8, 0x58, 0x73, 0x36, 0xBF,
+			0xB1, 0x18, 0x02, 0x4D, 0xB8, 0x67, 0x4A, 0x14
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_4 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0x57, 0x5F, 0x03, 0xA0, 0x8D, 0x8F, 0x40, 0x26,
+			0xE5, 0x64, 0x1F, 0x5B, 0x5C, 0xC2, 0xFD, 0x4B
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_5 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 8
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xB6, 0x35, 0x56, 0xE7, 0xBA, 0x46, 0xA3, 0x38,
+			0xED, 0xAD, 0x79, 0x9F, 0xB3, 0x5B, 0x34, 0xA8
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_6 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_zero_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xCA, 0x8A, 0x8A, 0x91, 0x5A, 0xF9, 0x76, 0xE3,
+			0xFF, 0x2C, 0xE4, 0x7D, 0xE5, 0x62, 0x75, 0x18
+		},
+		.len = 16
+	}
+};
+
+static const struct gcm_test_data gcm_test_case_192_7 = {
+	.key = {
+		.data = {
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,
+			0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,
+			0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C
+		},
+		.len = 24
+	},
+	.iv = {
+		.data = {
+			0xCA, 0xFE, 0xBA, 0xBE, 0xFA, 0xCE, 0xDB, 0xAD,
+			0xDE, 0xCA, 0xF8, 0x88
+		},
+		.len = 12
+	},
+	.aad = {
+		.data = gcm_aad_text,
+		.len = 12
+	},
+	.plaintext = {
+		.data = {
+			0xD9, 0x31, 0x32, 0x25, 0xF8, 0x84, 0x06, 0xE5,
+			0xA5, 0x59, 0x09, 0xC5, 0xAF, 0xF5, 0x26, 0x9A,
+			0x86, 0xA7, 0xA9, 0x53, 0x15, 0x34, 0xF7, 0xDA,
+			0x2E, 0x4C, 0x30, 0x3D, 0x8A, 0x31, 0x8A, 0x72,
+			0x1C, 0x3C, 0x0C, 0x95, 0x95, 0x68, 0x09, 0x53,
+			0x2F, 0xCF, 0x0E, 0x24, 0x49, 0xA6, 0xB5, 0x25,
+			0xB1, 0x6A, 0xED, 0xF5, 0xAA, 0x0D, 0xE6, 0x57,
+			0xBA, 0x63, 0x7B, 0x39
+		},
+		.len = 60
+	},
+	.ciphertext = {
+		.data = {
+			0x39, 0x80, 0xCA, 0x0B, 0x3C, 0x00, 0xE8, 0x41,
+			0xEB, 0x06, 0xFA, 0xC4, 0x87, 0x2A, 0x27, 0x57,
+			0x85, 0x9E, 0x1C, 0xEA, 0xA6, 0xEF, 0xD9, 0x84,
+			0x62, 0x85, 0x93, 0xB4, 0x0C, 0xA1, 0xE1, 0x9C,
+			0x7D, 0x77, 0x3D, 0x00, 0xC1, 0x44, 0xC5, 0x25,
+			0xAC, 0x61, 0x9D, 0x18, 0xC8, 0x4A, 0x3F, 0x47,
+			0x18, 0xE2, 0x44, 0x8B, 0x2F, 0xE3, 0x24, 0xD9,
+			0xCC, 0xDA, 0x27, 0x10
+		},
+		.len = 60
+	},
+	.auth_tag = {
+		.data = {
+			0xC2, 0xD8, 0x4C, 0x6B, 0xA8, 0x3B, 0xA5, 0x6B,
+			0x18, 0x9F, 0xE6, 0xEF, 0x66, 0x24, 0xDD, 0xDA
+		},
+		.len = 16
+	}
+};
+
 /** AES-256 Test Vectors */
 static const struct gcm_test_data gcm_test_case_256_1 = {
 	.key = {
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs
  2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
                       ` (2 preceding siblings ...)
  2017-07-04  0:12     ` [PATCH v3 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
@ 2017-07-04  0:12     ` Pablo de Lara
  3 siblings, 0 replies; 17+ messages in thread
From: Pablo de Lara @ 2017-07-04  0:12 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

QAT, OpenSSL and DPAA2 PMDs support 192-bit and 256-bit key sizes
for AES-GCM, apart from 128-bit keys. Therefore, these tests that were
only used by AES-NI MB PMD are extended to these other two PMDs.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 test/test/test_cryptodev.c | 145 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 145 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index e71736f..52f537a 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -7836,6 +7836,54 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
+		/** AES GCM Authenticated Encryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_7),
+
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_test_case_1),
@@ -8039,6 +8087,71 @@ static struct unit_test_suite cryptodev_openssl_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
+		/** AES GCM Authenticated Encryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_256_7),
+
+		/** AES GCM Authenticated Decryption 256 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_256_7),
+
 		/** AES GMAC Authentication */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_test_case_1),
@@ -8459,6 +8572,38 @@ static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_test_case_7),
 
+		/** AES GCM Authenticated Encryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_encryption_test_case_192_7),
+
+		/** AES GCM Authenticated Decryption 192 bits key */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_1),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_2),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_3),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_6),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_AES_GCM_auth_decryption_test_case_192_7),
+
 		/** AES GCM Authenticated Encryption 256 bits key */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encryption_test_case_256_1),
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/4] crypto/aesni_gcm: migrate to Multi-buffer library
  2017-07-04  0:12     ` [PATCH v3 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
@ 2017-07-04  9:43       ` Declan Doherty
  2017-07-04 10:17         ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 17+ messages in thread
From: Declan Doherty @ 2017-07-04  9:43 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, Sergio Gonzalez Monroy

On 04/07/17 01:12, Pablo de Lara wrote:
> Since Intel Multi Buffer library for IPSec has been updated to
> support Scatter Gather List, the AESNI GCM PMD can link
> to this library, instead of the ISA-L library.
> 
> This move eases the maintenance of the driver, as it will
> use the same library as the AESNI MB PMD.
> It also adds support for 192-bit keys.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> ---
>   devtools/test-build.sh                           |   4 +-
>   doc/guides/cryptodevs/aesni_gcm.rst              |  53 ++++++++---
>   doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
>   doc/guides/rel_notes/release_17_08.rst           |   8 ++
>   drivers/crypto/aesni_gcm/Makefile                |   9 +-
>   drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 ++++++++++++++++++--
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         | 111 +++++++++++++----------
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  14 ++-
>   drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  28 +++---
>   mk/rte.app.mk                                    |   3 +-
>   10 files changed, 238 insertions(+), 93 deletions(-)
> 
> diff --git a/devtools/test-build.sh b/devtools/test-build.sh
> index 079c8b8..c6dfaf0 100755
> --- a/devtools/test-build.sh
> +++ b/devtools/test-build.sh
> @@ -38,7 +38,6 @@ default_path=$PATH
>   # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
>   # - DPDK_DEP_ARCHIVE
>   # - DPDK_DEP_CFLAGS
> -# - DPDK_DEP_ISAL_CRYPTO (y/[n])
>   # - DPDK_DEP_LDFLAGS
>   # - DPDK_DEP_MOFED (y/[n])
>   # - DPDK_DEP_NUMA ([y]/n)
> @@ -121,7 +120,6 @@ reset_env ()
>   	unset CROSS
>   	unset DPDK_DEP_ARCHIVE
>   	unset DPDK_DEP_CFLAGS
> -	unset DPDK_DEP_ISAL_CRYPTO
>   	unset DPDK_DEP_LDFLAGS
>   	unset DPDK_DEP_MOFED
>   	unset DPDK_DEP_NUMA
> @@ -182,7 +180,7 @@ config () # <directory> <target> <options>
>   		sed -ri   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
>   		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
>   		sed -ri       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
> -		test "$DPDK_DEP_ISAL_CRYPTO" != y || \
> +		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
>   		sed -ri      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
>   		test -z "$LIBSSO_SNOW3G_PATH" || \
>   		sed -ri         's,(PMD_SNOW3G=)n,\1y,' $1/.config
> diff --git a/doc/guides/cryptodevs/aesni_gcm.rst b/doc/guides/cryptodevs/aesni_gcm.rst
> index 84cdc52..591c0b1 100644
> --- a/doc/guides/cryptodevs/aesni_gcm.rst
> +++ b/doc/guides/cryptodevs/aesni_gcm.rst
> @@ -1,5 +1,5 @@
>   ..  BSD LICENSE
> -    Copyright(c) 2016 Intel Corporation. All rights reserved.
> +    Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
>   
>       Redistribution and use in source and binary forms, with or without
>       modification, are permitted provided that the following conditions
> @@ -32,8 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
>   
>   
>   The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode crypto driver
> -support for utilizing Intel ISA-L crypto library, which provides operation acceleration
> -through the AES-NI instruction sets for AES-GCM authenticated cipher algorithm.
> +support for utilizing Intel multi buffer library (see AES-NI Multi-buffer PMD documentation
> +to learn more about it, including installation).
>   
>   Features
>   --------
> @@ -49,19 +49,51 @@ Authentication algorithms:
>   * RTE_CRYPTO_AUTH_AES_GCM
>   * RTE_CRYPTO_AUTH_AES_GMAC
>   

AES GCM should be listed under AEAD algorithms now

> +Limitations
> +-----------
> 

Acked-by: Declan Doherty <declan.doherty@intel.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library
  2017-06-30 14:16   ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Sergio Gonzalez Monroy
@ 2017-07-04 10:11     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2017-07-04 10:11 UTC (permalink / raw)
  To: Gonzalez Monroy, Sergio, Doherty, Declan; +Cc: dev



> -----Original Message-----
> From: Gonzalez Monroy, Sergio
> Sent: Friday, June 30, 2017 3:17 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Doherty,
> Declan <declan.doherty@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 0/4] AESNI GCM PMD: Migration from
> ISA-L to Multi-buffer library
> 
> On 28/06/2017 12:32, Pablo de Lara wrote:
> > AES-NI GCM PMD migrated previously from Multi-buffer Crypto library to
> > ISA-L Crypto library, to support several features that were not
> > supported by that time, such as GMAC algorithm and Scatter-gather list.
> >
> > Since version 0.45, Multi-buffer library
> > (https://github.com/01org/intel-ipsec-mb)
> > supports all these features, the PMD can link against this library again
> (version 0.46 now).
> >
> > This will improve maintainability, as now AESNI GCM PMD will share the
> > same library as AESNI MB PMD, having one less library to link against. It
> also adds support for 192-bit keys.
> >
> > In terms of performance, it has been improved, especially for some
> architectures.
> >
> > This patchset is migrating the PMD to link against Multi-buffer library
> v0.46.
> >
> > Changes in v2:
> >
> > - Supported Multi-buffer 0.46 library
> > - Added new tests to other PMD testsuites
> > - Rebased against latest dpdk-next-crypto code
> >
> > Pablo de Lara (4):
> >    crypto/aesni_gcm: migrate to Multi-buffer library
> >    test/crypto: rename some tests
> >    test/crypto: add AES GCM 192 tests
> >    test/crypto: extend AES-GCM 192/256 to other PMDs
> >
> >   devtools/test-build.sh                           |   4 +-
> >   doc/guides/cryptodevs/aesni_gcm.rst              |  18 +-
> >   doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
> >   doc/guides/rel_notes/release_17_08.rst           |   8 +
> >   drivers/crypto/aesni_gcm/Makefile                |   9 +-
> >   drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97 ++++-
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         |  98 +++--
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  18 +-
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  32 +-
> >   mk/rte.app.mk                                    |   3 +-
> >   test/test/test_cryptodev.c                       | 497 +++++++++++++++++------
> >   test/test/test_cryptodev_gcm_test_vectors.h      | 357
> ++++++++++++++++
> >   12 files changed, 922 insertions(+), 223 deletions(-)
> >
> 
> Series Acked-by: Sergio Gonzalez Monroy
> <sergio.gonzalez.monroy@intel.com>

Applied to dpdk-next-crypto.

Pablo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/4] crypto/aesni_gcm: migrate to Multi-buffer library
  2017-07-04  9:43       ` Declan Doherty
@ 2017-07-04 10:17         ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2017-07-04 10:17 UTC (permalink / raw)
  To: Doherty, Declan; +Cc: dev, Gonzalez Monroy, Sergio



> -----Original Message-----
> From: Doherty, Declan
> Sent: Tuesday, July 4, 2017 10:43 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Gonzalez Monroy, Sergio
> <sergio.gonzalez.monroy@intel.com>
> Subject: Re: [PATCH v3 1/4] crypto/aesni_gcm: migrate to Multi-buffer
> library
> 
> On 04/07/17 01:12, Pablo de Lara wrote:
> > Since Intel Multi Buffer library for IPSec has been updated to support
> > Scatter Gather List, the AESNI GCM PMD can link to this library,
> > instead of the ISA-L library.
> >
> > This move eases the maintenance of the driver, as it will use the same
> > library as the AESNI MB PMD.
> > It also adds support for 192-bit keys.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > Signed-off-by: Sergio Gonzalez Monroy
> > <sergio.gonzalez.monroy@intel.com>
> > ---
> >   devtools/test-build.sh                           |   4 +-
> >   doc/guides/cryptodevs/aesni_gcm.rst              |  53 ++++++++---
> >   doc/guides/cryptodevs/features/aesni_gcm.ini     |   4 +-
> >   doc/guides/rel_notes/release_17_08.rst           |   8 ++
> >   drivers/crypto/aesni_gcm/Makefile                |   9 +-
> >   drivers/crypto/aesni_gcm/aesni_gcm_ops.h         |  97
> ++++++++++++++++++--
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd.c         | 111
> +++++++++++++----------
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c     |  14 ++-
> >   drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h |  28 +++---
> >   mk/rte.app.mk                                    |   3 +-
> >   10 files changed, 238 insertions(+), 93 deletions(-)
> >
> > diff --git a/devtools/test-build.sh b/devtools/test-build.sh index
> > 079c8b8..c6dfaf0 100755
> > --- a/devtools/test-build.sh
> > +++ b/devtools/test-build.sh
> > @@ -38,7 +38,6 @@ default_path=$PATH
> >   # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2
> defconfig2)
> >   # - DPDK_DEP_ARCHIVE
> >   # - DPDK_DEP_CFLAGS
> > -# - DPDK_DEP_ISAL_CRYPTO (y/[n])
> >   # - DPDK_DEP_LDFLAGS
> >   # - DPDK_DEP_MOFED (y/[n])
> >   # - DPDK_DEP_NUMA ([y]/n)
> > @@ -121,7 +120,6 @@ reset_env ()
> >   	unset CROSS
> >   	unset DPDK_DEP_ARCHIVE
> >   	unset DPDK_DEP_CFLAGS
> > -	unset DPDK_DEP_ISAL_CRYPTO
> >   	unset DPDK_DEP_LDFLAGS
> >   	unset DPDK_DEP_MOFED
> >   	unset DPDK_DEP_NUMA
> > @@ -182,7 +180,7 @@ config () # <directory> <target> <options>
> >   		sed -ri   's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
> >   		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
> >   		sed -ri       's,(PMD_AESNI_MB=)n,\1y,' $1/.config
> > -		test "$DPDK_DEP_ISAL_CRYPTO" != y || \
> > +		test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
> >   		sed -ri      's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
> >   		test -z "$LIBSSO_SNOW3G_PATH" || \
> >   		sed -ri         's,(PMD_SNOW3G=)n,\1y,' $1/.config
> > diff --git a/doc/guides/cryptodevs/aesni_gcm.rst
> > b/doc/guides/cryptodevs/aesni_gcm.rst
> > index 84cdc52..591c0b1 100644
> > --- a/doc/guides/cryptodevs/aesni_gcm.rst
> > +++ b/doc/guides/cryptodevs/aesni_gcm.rst
> > @@ -1,5 +1,5 @@
> >   ..  BSD LICENSE
> > -    Copyright(c) 2016 Intel Corporation. All rights reserved.
> > +    Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
> >
> >       Redistribution and use in source and binary forms, with or without
> >       modification, are permitted provided that the following
> > conditions @@ -32,8 +32,8 @@ AES-NI GCM Crypto Poll Mode Driver
> >
> >
> >   The AES-NI GCM PMD (**librte_pmd_aesni_gcm**) provides poll mode
> > crypto driver -support for utilizing Intel ISA-L crypto library, which
> > provides operation acceleration -through the AES-NI instruction sets for
> AES-GCM authenticated cipher algorithm.
> > +support for utilizing Intel multi buffer library (see AES-NI
> > +Multi-buffer PMD documentation to learn more about it, including
> installation).
> >
> >   Features
> >   --------
> > @@ -49,19 +49,51 @@ Authentication algorithms:
> >   * RTE_CRYPTO_AUTH_AES_GCM
> >   * RTE_CRYPTO_AUTH_AES_GMAC
> >
> 
> AES GCM should be listed under AEAD algorithms now
> 
> > +Limitations
> > +-----------
> >
> 
> Acked-by: Declan Doherty <declan.doherty@intel.com>
> 

Hi,

Will fix the documentation when merging the patch.

Thanks for the review!
Pablo

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-07-04 10:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 10:16 [PATCH 0/2] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
2017-05-26 10:16 ` [PATCH 1/2] crypto/aesni_gcm: migrate " Pablo de Lara
2017-05-26 10:16 ` [PATCH 2/2] test/crypto: add AES GCM 192 tests Pablo de Lara
2017-06-28 11:32 ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Pablo de Lara
2017-06-28 11:32   ` [PATCH v2 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
2017-06-28 11:32   ` [PATCH v2 2/4] test/crypto: rename some tests Pablo de Lara
2017-06-28 11:32   ` [PATCH v2 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
2017-06-28 11:32   ` [PATCH v2 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara
2017-06-30 14:16   ` [PATCH v2 0/4] AESNI GCM PMD: Migration from ISA-L to Multi-buffer library Sergio Gonzalez Monroy
2017-07-04 10:11     ` De Lara Guarch, Pablo
2017-07-04  0:12   ` [PATCH v3 " Pablo de Lara
2017-07-04  0:12     ` [PATCH v3 1/4] crypto/aesni_gcm: migrate " Pablo de Lara
2017-07-04  9:43       ` Declan Doherty
2017-07-04 10:17         ` De Lara Guarch, Pablo
2017-07-04  0:12     ` [PATCH v3 2/4] test/crypto: rename some tests Pablo de Lara
2017-07-04  0:12     ` [PATCH v3 3/4] test/crypto: add AES GCM 192 tests Pablo de Lara
2017-07-04  0:12     ` [PATCH v3 4/4] test/crypto: extend AES-GCM 192/256 to other PMDs Pablo de Lara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.