[API-NEXT,v1,2/3] api: crypto: add bitstring operation capability

Message ID 1518814818-27115-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [API-NEXT,v1,1/3] api: crypto: provide definitions for 3GPP crypto algorithms
Related show

Commit Message

Github ODP bot Feb. 16, 2018, 9 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


For several wireless communication algorithms it is expected that they
operate on bit strings, which are not byte-aligned. Add cipher and auth
flags, denoting that this cipher/auth can be enabled to work in
bit-string mode.

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

---
/** Email created from pull request 464 (lumag:crypto-3gpp)
 ** https://github.com/Linaro/odp/pull/464
 ** Patch: https://github.com/Linaro/odp/pull/464.patch
 ** Base sha: af7be638ef9ac98bdb1f2e4917f152889eb1850f
 ** Merge commit sha: da657b8b144e5fd9f465c0a4a0698ecd7dad4eef
 **/
 include/odp/api/spec/crypto.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 654ae7bb9..03bb69775 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -510,6 +510,15 @@  typedef struct odp_crypto_session_param_t {
 	 */
 	odp_pool_t output_pool;
 
+	/** Bitstring mode
+	 *
+	 *  Cipher and auth will operate in bitstring mode. Fields cipher_range
+	 *  and auth_range will count bits for offset and length, rather than
+	 *  full bytes. Note: not algorithms support this mode of operation, it
+	 *  has to be reported via bitstring field in cipher and auth
+	 *  capability. */
+	odp_bool_t bitstring;
+
 } odp_crypto_session_param_t;
 
 /** @deprecated  Use odp_crypto_session_param_t instead */
@@ -755,6 +764,14 @@  typedef struct odp_crypto_cipher_capability_t {
 	/** IV length in bytes */
 	uint32_t iv_len;
 
+	/** Bitstring operation is supported
+	 *
+	 * Support operation on unaligned bit strings, rather than byte-aligned
+	 * strings: cipher_range in parameter in odp_crypto_op_param_t and
+	 * odp_crypto_packet_op_param_t will be expressed in bits, rather than
+	 * bytes */
+	odp_bool_t bitstring;
+
 } odp_crypto_cipher_capability_t;
 
 /**
@@ -783,6 +800,14 @@  typedef struct odp_crypto_auth_capability_t {
 		uint32_t inc;
 	} aad_len;
 
+	/** Bitstring operation is supported
+	 *
+	 * Support operation on unaligned bit strings, rather than byte-aligned
+	 * strings: auth_range in parameter in odp_crypto_op_param_t and
+	 * odp_crypto_packet_op_param_t will be expressed in bits, rather than
+	 * bytes */
+	odp_bool_t bitstring;
+
 } odp_crypto_auth_capability_t;
 
 /**