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

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