diff mbox series

[API-NEXT,v3,2/6] api: crypto: add separate auth IV

Message ID 1514242817-22123-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v3,1/6] linux-gen: crypto: move session type to odp_crypto module | expand

Commit Message

Github ODP bot Dec. 25, 2017, 11 p.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>

---
/** 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: a5f07dbf95f982b7c5898434e56164ff976c0a0f
 ** Merge commit sha: 17da319d68f1b79fbec6d76e925b5d4c9665aaf3
 **/
 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 81fecbc36..033056591 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -327,6 +327,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.
@@ -397,6 +400,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
@@ -433,6 +439,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
@@ -598,6 +607,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 */