[dpdk-dev] [PATCH] cryptodev: remove AAD size in auth capabilities

Pablo de Lara pablo.de.lara.guarch at intel.com
Tue Jul 11 08:30:43 CEST 2017


Additional Authenticated Data (AAD) was removed from the
authentication parameters, but still the supported size
was part of the authentication capabilities of a PMD.

Fixes: 4428eda8bb75 ("cryptodev: remove AAD from authentication structure")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 app/test-crypto-perf/main.c                    |  1 -
 doc/guides/rel_notes/release_17_08.rst         |  2 ++
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c   |  1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c |  7 -------
 drivers/crypto/armv8/rte_armv8_pmd_ops.c       |  2 --
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h      |  6 ------
 drivers/crypto/kasumi/rte_kasumi_pmd_ops.c     |  3 +--
 drivers/crypto/null/null_crypto_pmd_ops.c      |  1 -
 drivers/crypto/openssl/rte_openssl_pmd_ops.c   | 12 ------------
 drivers/crypto/qat/qat_crypto_capabilities.h   | 16 +++-------------
 drivers/crypto/snow3g/rte_snow3g_pmd_ops.c     |  3 +--
 drivers/crypto/zuc/rte_zuc_pmd_ops.c           |  3 +--
 lib/librte_cryptodev/rte_cryptodev.c           |  6 +-----
 lib/librte_cryptodev/rte_cryptodev.h           |  4 +---
 14 files changed, 10 insertions(+), 57 deletions(-)

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 51345ea..99f5d3e 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -208,7 +208,6 @@ cperf_verify_devices_capabilities(struct cperf_options *opts,
 					capability,
 					opts->auth_key_sz,
 					opts->digest_sz,
-					0,
 					opts->auth_iv_sz);
 			if (ret != 0)
 				return ret;
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index 6c00509..36e9ddb 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -257,6 +257,8 @@ API Changes
     ``mempool``, instead of ``device id`` and ``rte_crypto_sym_xform``.
   * Remove ``device id`` parameter from ``rte_cryptodev_sym_session_free()``.
   * Added new field ``session_pool`` to ``rte_cryptodev_queue_pair_setup()``.
+  * Removed ``aad_size`` parameter from ``rte_cryptodev_sym_capability_check_auth()``.
+  * Added ``iv_size`` parameter to ``rte_cryptodev_sym_capability_check_auth().
 
 
 ABI Changes
diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index 6d24a32..af107a5 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -56,7 +56,6 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 					.max = 16,
 					.increment = 4
 				},
-				.aad_size = { 0 },
 				.iv_size = {
 					.min = 12,
 					.max = 12,
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
index e3a6ef5..d033408 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
@@ -57,7 +57,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 12,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -79,7 +78,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 12,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -101,7 +99,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 14,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -123,7 +120,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 16,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -145,7 +141,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 24,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -167,7 +162,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 32,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -189,7 +183,6 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
 					.max = 12,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
index 05a7703..cc77d40 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd_ops.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c
@@ -59,7 +59,6 @@ static const struct rte_cryptodev_capabilities
 						.max = 20,
 						.increment = 0
 					},
-					.aad_size = { 0 },
 					.iv_size = { 0 }
 				}, }
 			}, }
@@ -81,7 +80,6 @@ static const struct rte_cryptodev_capabilities
 						.max = 32,
 						.increment = 0
 					},
-					.aad_size = { 0 },
 					.iv_size = { 0 }
 				}, }
 			}, }
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
index bd85e3a..2bf4edc 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
@@ -209,7 +209,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 					.max = 16,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -231,7 +230,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 					.max = 20,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -253,7 +251,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 					.max = 28,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -275,7 +272,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 						.max = 32,
 						.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 				}, }
 			}, }
@@ -297,7 +293,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 					.max = 48,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -319,7 +314,6 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
 					.max = 64,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
index 1d9c0fc..e92ccbd 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
@@ -60,8 +60,7 @@ static const struct rte_cryptodev_capabilities kasumi_pmd_capabilities[] = {
 					.min = 8,
 					.max = 8,
 					.increment = 0
-				},
-				.aad_size = { 0 }
+				}
 			}, }
 		}, }
 	},
diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index c618e6b..13e7a19 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -56,7 +56,6 @@ static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] =
 					.max = 0,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, },
 		}, },
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 1db4d14..ae367ac 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -57,7 +57,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 16,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -79,7 +78,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 16,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -101,7 +99,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 20,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -123,7 +120,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 20,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -145,7 +141,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 28,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -167,7 +162,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 28,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -189,7 +183,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 32,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -211,7 +204,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 32,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -233,7 +225,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 48,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -255,7 +246,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 48,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -277,7 +267,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 64,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
@@ -299,7 +288,6 @@ static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
 					.max = 64,
 					.increment = 0
 				},
-				.aad_size = { 0 },
 				.iv_size = { 0 }
 			}, }
 		}, }
diff --git a/drivers/crypto/qat/qat_crypto_capabilities.h b/drivers/crypto/qat/qat_crypto_capabilities.h
index fee8ee1..16b2c11 100644
--- a/drivers/crypto/qat/qat_crypto_capabilities.h
+++ b/drivers/crypto/qat/qat_crypto_capabilities.h
@@ -52,7 +52,6 @@
 					.max = 20,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -74,7 +73,6 @@
 					.max = 28,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -96,7 +94,6 @@
 					.max = 32,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -118,7 +115,6 @@
 					.max = 48,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -140,7 +136,6 @@
 					.max = 64,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -162,7 +157,6 @@
 					.max = 16,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, }						\
 		}, }							\
@@ -265,8 +259,7 @@
 					.min = 16,			\
 					.max = 16,			\
 					.increment = 0			\
-				},					\
-				.aad_size = { 0 }			\
+				}					\
 			}, }						\
 		}, }							\
 	},								\
@@ -367,7 +360,6 @@
 					.max = 0,			\
 					.increment = 0			\
 				},					\
-				.aad_size = { 0 },			\
 				.iv_size = { 0 }			\
 			}, },						\
 		}, },							\
@@ -433,8 +425,7 @@
 					.min = 8,			\
 					.max = 8,			\
 					.increment = 0			\
-				},					\
-				.aad_size = { 0 }			\
+				}					\
 			}, }						\
 		}, }							\
 	},								\
@@ -561,8 +552,7 @@
 					.min = 16,			\
 					.max = 16,			\
 					.increment = 0			\
-				},					\
-				.aad_size = { 0 }			\
+				}					\
 			}, }						\
 		}, }							\
 	}
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
index 108f251..62ba3a6 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
@@ -60,8 +60,7 @@ static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
 					.min = 16,
 					.max = 16,
 					.increment = 0
-				},
-				.aad_size = { 0 }
+				}
 			}, }
 		}, }
 	},
diff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
index 7cb3f1c..7624e67 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c
@@ -60,8 +60,7 @@ static const struct rte_cryptodev_capabilities zuc_pmd_capabilities[] = {
 					.min = 16,
 					.max = 16,
 					.increment = 0
-				},
-				.aad_size = { 0 }
+				}
 			}, }
 		}, }
 	},
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 8ee5d47..bdea267 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -311,8 +311,7 @@ rte_cryptodev_sym_capability_check_cipher(
 int
 rte_cryptodev_sym_capability_check_auth(
 		const struct rte_cryptodev_symmetric_capability *capability,
-		uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
-		uint16_t iv_size)
+		uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
 {
 	if (param_range_check(key_size, capability->auth.key_size))
 		return -1;
@@ -320,9 +319,6 @@ rte_cryptodev_sym_capability_check_auth(
 	if (param_range_check(digest_size, capability->auth.digest_size))
 		return -1;
 
-	if (param_range_check(aad_size, capability->auth.aad_size))
-		return -1;
-
 	if (param_range_check(iv_size, capability->auth.iv_size))
 		return -1;
 
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index ca7cbdd..3ec8af9 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -238,7 +238,6 @@ rte_cryptodev_sym_capability_check_cipher(
  * @param	capability	Description of the symmetric crypto capability.
  * @param	key_size	Auth key size.
  * @param	digest_size	Auth digest size.
- * @param	aad_size	Auth aad size.
  * @param	iv_size		Auth initial vector size.
  *
  * @return
@@ -248,8 +247,7 @@ rte_cryptodev_sym_capability_check_cipher(
 int
 rte_cryptodev_sym_capability_check_auth(
 		const struct rte_cryptodev_symmetric_capability *capability,
-		uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
-		uint16_t iv_size);
+		uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
 
 /**
  * Check if key, digest, AAD and initial vector sizes are supported
-- 
2.9.4



More information about the dev mailing list