From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

Currently IPsec uses capabilities from crypto module to report supported
key lengths. Crypto capabilities also contain additional data (like
digest length, IV len, AAD len, etc. However this data is not relevant
for IPsec, as most of such variables are fixed by protocol standards.
To simplify application code provide copies of cipher and auth
capabilities structures containing only relevant data (key lengths).

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
/** Email created from pull request 351 (lumag:ipsec_crypto_caps)
 ** https://github.com/Linaro/odp/pull/351
 ** Patch: https://github.com/Linaro/odp/pull/351.patch
 ** Base sha: 12fd3a9224a856271934986a1bad981843915d68
 ** Merge commit sha: ba5f93d7379836dc97d5a6688febb81dcd7694b6
 **/
 include/odp/api/spec/ipsec.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 538472a5e..731cd10de 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -280,6 +280,24 @@ typedef struct odp_ipsec_capability_t {
 
 } odp_ipsec_capability_t;
 
+/**
+ * Cipher algorithm capabilities
+ */
+typedef struct odp_ipsec_cipher_capability_t {
+       /** Key length in bytes */
+       uint32_t key_len;
+
+} odp_ipsec_cipher_capability_t;
+
+/**
+ * Authentication algorithm capabilities
+ */
+typedef struct odp_ipsec_auth_capability_t {
+       /** Key length in bytes */
+       uint32_t key_len;
+
+} odp_ipsec_auth_capability_t;
+
 /**
  * IPSEC configuration options
  */
@@ -744,7 +762,7 @@ int odp_ipsec_capability(odp_ipsec_capability_t *capa);
  * @retval <0 on failure
  */
 int odp_ipsec_cipher_capability(odp_cipher_alg_t cipher,
-                               odp_crypto_cipher_capability_t capa[], int num);
+                               odp_ipsec_cipher_capability_t capa[], int num);
 
 /**
  * Query supported IPSEC authentication algorithm capabilities
@@ -766,7 +784,7 @@ int odp_ipsec_cipher_capability(odp_cipher_alg_t cipher,
  * @retval <0 on failure
  */
 int odp_ipsec_auth_capability(odp_auth_alg_t auth,
-                             odp_crypto_auth_capability_t capa[], int num);
+                             odp_ipsec_auth_capability_t capa[], int num);
 
 /**
  * Initialize IPSEC configuration options

Reply via email to