DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in symmetric API
@ 2020-10-22 16:20 Pablo de Lara
  2020-10-22 16:20 ` [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for " Pablo de Lara
  2020-10-29 18:45 ` [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in " Akhil Goyal
  0 siblings, 2 replies; 4+ messages in thread
From: Pablo de Lara @ 2020-10-22 16:20 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

Add support for Chacha20-Poly1305 in the crypto symmetric API.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index fbbb38af0..03186485f 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -1108,7 +1108,8 @@ auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,
 static inline void
 set_cpu_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_session *session,
 		union rte_crypto_sym_ofs sofs, void *buf, uint32_t len,
-		void *iv, void *aad, void *digest, void *udata)
+		struct rte_crypto_va_iova_ptr *iv,
+		struct rte_crypto_va_iova_ptr *aad, void *digest, void *udata)
 {
 	/* Set crypto operation */
 	job->chain_order = session->chain_order;
@@ -1121,7 +1122,7 @@ set_cpu_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_session *session,
 
 	/* Set authentication parameters */
 	job->hash_alg = session->auth.algo;
-	job->iv = iv;
+	job->iv = iv->va;
 
 	switch (job->hash_alg) {
 	case AES_XCBC:
@@ -1136,7 +1137,7 @@ set_cpu_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_session *session,
 		break;
 
 	case AES_CCM:
-		job->u.CCM.aad = (uint8_t *)aad + 18;
+		job->u.CCM.aad = (uint8_t *)aad->va + 18;
 		job->u.CCM.aad_len_in_bytes = session->aead.aad_len;
 		job->aes_enc_key_expanded =
 				session->cipher.expanded_aes_keys.encode;
@@ -1157,7 +1158,7 @@ set_cpu_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_session *session,
 
 	case AES_GMAC:
 		if (session->cipher.mode == GCM) {
-			job->u.GCM.aad = aad;
+			job->u.GCM.aad = aad->va;
 			job->u.GCM.aad_len_in_bytes = session->aead.aad_len;
 		} else {
 			/* For GMAC */
@@ -1169,6 +1170,14 @@ set_cpu_mb_job_params(JOB_AES_HMAC *job, struct aesni_mb_session *session,
 		job->aes_dec_key_expanded = &session->cipher.gcm_key;
 		break;
 
+#if IMB_VERSION(0, 54, 3) <= IMB_VERSION_NUM
+	case IMB_AUTH_CHACHA20_POLY1305:
+		job->u.CHACHA20_POLY1305.aad = aad->va;
+		job->u.CHACHA20_POLY1305.aad_len_in_bytes = session->aead.aad_len;
+		job->aes_enc_key_expanded = session->cipher.expanded_aes_keys.encode;
+		job->aes_dec_key_expanded = session->cipher.expanded_aes_keys.encode;
+		break;
+#endif
 	default:
 		job->u.HMAC._hashed_auth_key_xor_ipad =
 				session->auth.pads.inner;
@@ -2010,8 +2019,8 @@ aesni_mb_cpu_crypto_process_bulk(struct rte_cryptodev *dev,
 		}
 
 		/* Submit job for processing */
-		set_cpu_mb_job_params(job, s, sofs, buf, len, vec->iv[i].va,
-			vec->aad[i].va, tmp_dgst[i], &vec->status[i]);
+		set_cpu_mb_job_params(job, s, sofs, buf, len, &vec->iv[i],
+			&vec->aad[i], tmp_dgst[i], &vec->status[i]);
 		job = submit_sync_job(mb_mgr);
 		j++;
 
-- 
2.27.0


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

* [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for symmetric API
  2020-10-22 16:20 [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in symmetric API Pablo de Lara
@ 2020-10-22 16:20 ` Pablo de Lara
  2020-10-26 18:45   ` Akhil Goyal
  2020-10-29 18:45 ` [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in " Akhil Goyal
  1 sibling, 1 reply; 4+ messages in thread
From: Pablo de Lara @ 2020-10-22 16:20 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Pablo de Lara

SNOW3G, KASUMI and ZUC algorithms have been added to
aesni_mb PMD in this release. These algorithms are not supported
for the crypto symmetric API, so the crypto tests for these algorithms
are disabled.

Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9")
Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2")
Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3")

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

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 1d4c46f08..f37841950 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2674,6 +2674,9 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2762,6 +2765,9 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2844,6 +2850,9 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2930,6 +2939,9 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -3151,6 +3163,9 @@ test_kasumi_encryption(const struct kasumi_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3259,6 +3274,9 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create KASUMI session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3343,6 +3361,9 @@ test_kasumi_encryption_oop(const struct kasumi_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create KASUMI session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3427,6 +3448,9 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -3515,6 +3539,9 @@ test_kasumi_decryption_oop(const struct kasumi_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create KASUMI session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3594,6 +3621,9 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3683,6 +3713,9 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3772,6 +3805,9 @@ test_snow3g_encryption_oop(const struct snow3g_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create SNOW 3G session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3858,6 +3894,9 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -3980,6 +4019,9 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create SNOW 3G session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -4081,6 +4123,9 @@ static int test_snow3g_decryption(const struct snow3g_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -4167,6 +4212,9 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata)
 	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Create SNOW 3G session */
 	retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
 					RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -4260,6 +4308,9 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Check if device supports ZUC EEA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
@@ -4358,6 +4409,9 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -4475,6 +4529,9 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,
 			&cap_idx) == NULL)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -4664,6 +4721,9 @@ test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata,
 			&cap_idx) == NULL)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -4878,6 +4938,9 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	if (op_mode == OUT_OF_PLACE) {
 		if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
 			return -ENOTSUP;
@@ -5059,6 +5122,9 @@ test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata,
 			&cap_idx) == NULL)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -5255,6 +5321,9 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Verify the capabilities */
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -5368,6 +5437,9 @@ test_zuc_encryption(const struct wireless_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	struct rte_cryptodev_sym_capability_idx cap_idx;
 
 	/* Check if device supports ZUC EEA3 */
@@ -5460,6 +5532,9 @@ test_zuc_encryption_sgl(const struct wireless_test_data *tdata)
 			&cap_idx) == NULL)
 		return -ENOTSUP;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -5566,6 +5641,9 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
 		return -ENOTSUP;
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return -ENOTSUP;
+
 	/* Check if device supports ZUC EIA3 */
 	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for symmetric API
  2020-10-22 16:20 ` [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for " Pablo de Lara
@ 2020-10-26 18:45   ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2020-10-26 18:45 UTC (permalink / raw)
  To: Pablo de Lara, declan.doherty; +Cc: dev

> Subject: [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for
> symmetric API

The patch content is for the synchronous CPU crypto APIs and not 
Symmetric API.

> 
> SNOW3G, KASUMI and ZUC algorithms have been added to
> aesni_mb PMD in this release. These algorithms are not supported
> for the crypto symmetric API, so the crypto tests for these algorithms
> are disabled.
> 
> Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9")
> Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2")
> Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---

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

* Re: [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in symmetric API
  2020-10-22 16:20 [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in symmetric API Pablo de Lara
  2020-10-22 16:20 ` [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for " Pablo de Lara
@ 2020-10-29 18:45 ` Akhil Goyal
  1 sibling, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2020-10-29 18:45 UTC (permalink / raw)
  To: Pablo de Lara, declan.doherty; +Cc: dev

> Subject: [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in
> symmetric API
> 
> Add support for Chacha20-Poly1305 in the crypto symmetric API.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
Subject and description updated  for symmetric->synchronous

Series applied to dpdk-next-crypto

Thanks.


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

end of thread, other threads:[~2020-10-29 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 16:20 [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in symmetric API Pablo de Lara
2020-10-22 16:20 ` [dpdk-dev] [PATCH 2/2] test/crypto: disable wireless tests for " Pablo de Lara
2020-10-26 18:45   ` Akhil Goyal
2020-10-29 18:45 ` [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: support Chacha-Poly in " Akhil Goyal

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git