diff mbox series

[API-NEXT,v1,1/1] api: crypto: session level AAD length

Message ID 1510045207-24934-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/1] api: crypto: session level AAD length | expand

Commit Message

Github ODP bot Nov. 7, 2017, 9 a.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Added AAD length to crypto session level since it's likely
to be constant per session. Also some implementations (such
as DPDK) expect a constant AAD length at session create time.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 279 (psavol:next-crypto-aad-len)
 ** https://github.com/Linaro/odp/pull/279
 ** Patch: https://github.com/Linaro/odp/pull/279.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: 0e950e0561d1388ab2a90b75dc85bb1a9e47fd04
 **/
 include/odp/api/spec/crypto.h | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 7dcb71264..7630cc7c9 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -310,6 +310,19 @@  typedef struct odp_crypto_session_param_t {
 	 */
 	uint32_t auth_digest_len;
 
+	/** Authentication Additional Authenticated Data (AAD) length in bytes
+	 *
+	 *  This parameter is used when AAD length is constant for all
+	 *  operations (packets) of the session. When AAD length varies, this
+	 *  must be set to zero and operation level AAD length parameter is
+	 *  used instead. Both session and operation level parameters must not
+	 *  be used simultaneously.
+	 *
+	 *  Use odp_crypto_auth_capability() for supported AAD lengths.
+	 *  The default value is zero.
+	 */
+	uint32_t auth_aad_len;
+
 	/** Async mode completion event queue
 	 *
 	 *  The completion queue is used to return completions from
@@ -381,8 +394,15 @@  typedef struct odp_crypto_op_param_t {
 		/** Pointer to ADD */
 		uint8_t *ptr;
 
-		/** AAD length in bytes. Use odp_crypto_auth_capability() for
-		 *  supported AAD lengths. */
+		/** AAD length in bytes.
+		 *
+		 *  Used only when AAD length is variable within the session.
+		 *  When AAD length is constant, this must be set to zero and
+		 *  session level AAD length parameter is used instead.
+		 *
+		 *  Use odp_crypto_auth_capability() for supported AAD lengths.
+		 *  The default value is zero.
+		 */
 		uint32_t length;
 	} aad;
 
@@ -422,8 +442,15 @@  typedef struct odp_crypto_packet_op_param_t {
 		/** Pointer to ADD */
 		uint8_t *ptr;
 
-		/** AAD length in bytes. Use odp_crypto_auth_capability() for
-		 *  supported AAD lengths. */
+		/** AAD length in bytes.
+		 *
+		 *  Used only when AAD length is variable within the session.
+		 *  When AAD length is constant, this must be set to zero and
+		 *  session level AAD length parameter is used instead.
+		 *
+		 *  Use odp_crypto_auth_capability() for supported AAD lengths.
+		 *  The default value is zero.
+		 */
 		uint32_t length;
 	} aad;