Skip to content

Commit

Permalink
api: crypto: add bitstring operation capability
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
  • Loading branch information
Dmitry Eremin-Solenikov authored and muvarov committed Jul 18, 2018
1 parent 09da892 commit f5b1a18
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions include/odp/api/spec/crypto.h
Expand Up @@ -755,6 +755,22 @@ typedef struct odp_crypto_cipher_capability_t {
/** IV length in bytes */
uint32_t iv_len;

/** Cipher is operating in bitwise mode
*
* This cipher works on series of bits, rather than sequences of bytes:
* cipher_range in odp_crypto_op_param_t and
* odp_crypto_packet_op_param_t will use bits, rather than bytes.
*
* Note: data buffer MUST start on the byte boundary, using offset
* which is not divisible by 8 is unsupported and will result in
* unspecified behaviour.
*
* Note2: currently data length MUST be divisible by 8. Specifying data
* which does not consist of full bytes will result in unspecified
* behaviour.
*/
odp_bool_t bit_mode;

} odp_crypto_cipher_capability_t;

/**
Expand Down Expand Up @@ -783,6 +799,18 @@ typedef struct odp_crypto_auth_capability_t {
uint32_t inc;
} aad_len;

/** Auth is operating in bitstring mode
*
* This auth works on series of bits, rather than sequences of bytes:
* auth_range in odp_crypto_op_param_t and
* odp_crypto_packet_op_param_t will use bits, rather than bytes.
*
* Note: data buffer MUST start on the byte boundary, using offset
* which is not divisible by 8 is unsupported and will result in
* unpredictable behaviour.
*/
odp_bool_t bit_mode;

} odp_crypto_auth_capability_t;

/**
Expand Down

0 comments on commit f5b1a18

Please sign in to comment.