[API-NEXT,v5,4/6] api: crypto: add separate auth IV

Message ID 1515024013-30222-5-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Add separate auth IV
Related show

Commit Message

Github ODP bot Jan. 4, 2018, midnight
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>

---
/** Email created from pull request 352 (lumag:crypto_gmac_iv)
 ** https://github.com/Linaro/odp/pull/352
 ** Patch: https://github.com/Linaro/odp/pull/352.patch
 ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4
 ** Merge commit sha: 5a1e35f8e8d8df2bc17b098f7c9c92611ea98e23
 **/
 include/odp/api/spec/crypto.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 25ce2f86c..99ae4576a 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.
@@ -403,6 +406,9 @@  typedef struct odp_crypto_op_param_t {
 	/** Override session IV pointer */
 	uint8_t *override_iv_ptr;
 
+	/** Override session authentication IV pointer */
+	uint8_t *override_auth_iv_ptr;
+
 	/** Offset from start of packet for hash result
 	 *
 	 *  Specifies the offset where the hash result is to be stored. In case
@@ -439,6 +445,9 @@  typedef struct odp_crypto_packet_op_param_t {
 	/** Override session IV pointer */
 	uint8_t *override_iv_ptr;
 
+	/** Override session authentication IV pointer */
+	uint8_t *override_auth_iv_ptr;
+
 	/** Offset from start of packet for hash result
 	 *
 	 *  Specifies the offset where the hash result is to be stored. In case
@@ -604,6 +613,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 */