diff mbox series

[v1,5/12] api: crypto: add separate auth IV

Message ID 1516608010-2535-6-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/12] validation: crypto: stop declaring test functions as public | expand

Commit Message

Github ODP bot Jan. 22, 2018, 8 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


GMAC auth algorithm requires IV to work. Instead of hacking the
ODP_CIPHER_ALG_NULL iv to include value for ODP_AUTH_ALG_GMAC, provide
separate iv (in auth capability, session params and operation params).

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

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

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 413 (SonicwallYhe:api-next)
 ** https://github.com/Linaro/odp/pull/413
 ** Patch: https://github.com/Linaro/odp/pull/413.patch
 ** Base sha: 5a4502fc6bc53e6503169da3028f456b64811a0b
 ** Merge commit sha: 6669be7b55ab094f9e27d2101a6bb005ca87e405
 **/
 include/odp/api/spec/crypto.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index e44892fbf..ea2a14d65 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -333,6 +333,9 @@  typedef struct odp_crypto_session_param_t {
 	 */
 	odp_crypto_key_t auth_key;
 
+	/** Authentication Initialization Vector (IV) */
+	odp_crypto_iv_t auth_iv;
+
 	/** Authentication digest length in bytes
 	 *
 	 *  Use odp_crypto_auth_capability() for supported digest lengths.
@@ -408,6 +411,9 @@  typedef struct odp_crypto_op_param_t {
 		uint8_t *cipher_iv_ptr;
 	};
 
+	/** Override session authentication IV pointer */
+	uint8_t *auth_iv_ptr;
+
 	/** Offset from start of packet for hash result
 	 *
 	 *  Specifies the offset where the hash result is to be stored. In case
@@ -449,6 +455,9 @@  typedef struct odp_crypto_packet_op_param_t {
 		uint8_t *cipher_iv_ptr;
 	};
 
+	/** Override session IV pointer for authentication */
+	uint8_t *auth_iv_ptr;
+
 	/** Offset from start of packet for hash result
 	 *
 	 *  Specifies the offset where the hash result is to be stored. In case
@@ -614,6 +623,9 @@  typedef struct odp_crypto_auth_capability_t {
 	/** Key length in bytes */
 	uint32_t key_len;
 
+	/** IV length in bytes */
+	uint32_t iv_len;
+
 	/** Additional Authenticated Data (AAD) lengths */
 	struct {
 		/** Minimum AAD length in bytes */