diff options
author | Damjan Marion <damarion@cisco.com> | 2019-03-25 15:54:40 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-03-29 12:04:35 +0000 |
commit | b4fff3a39715c3e405b92442026bfddc3be37b27 (patch) | |
tree | 7fa86a7ccd351adf22aaca060a482b04c90d45ac /src/vnet/crypto/crypto.h | |
parent | d7603d97e046d59aba6864b208c181b39fc72b52 (diff) |
ipsec: esp-decrypt rework
Change-Id: Icf83c876d0880d1872b84e0a3d34be654b76149f
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/crypto/crypto.h')
-rw-r--r-- | src/vnet/crypto/crypto.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/vnet/crypto/crypto.h b/src/vnet/crypto/crypto.h index 7a9ca2c2278..2bd40dc9c75 100644 --- a/src/vnet/crypto/crypto.h +++ b/src/vnet/crypto/crypto.h @@ -57,12 +57,9 @@ typedef enum foreach_hmac_alg #undef _ VNET_CRYPTO_N_OP_TYPES, -} __attribute__ ((packed)) vnet_crypto_op_type_t; +} vnet_crypto_op_type_t; /* *INDENT-ON* */ -STATIC_ASSERT (sizeof (vnet_crypto_op_type_t) <= 2, - "crypto op type > 2 bytes"); - typedef struct { char *name; @@ -73,19 +70,18 @@ typedef enum VNET_CRYPTO_OP_STATUS_PENDING, VNET_CRYPTO_OP_STATUS_COMPLETED, VNET_CRYPTO_OP_STATUS_FAIL_NO_HANDLER, -} __attribute__ ((packed)) vnet_crypto_op_status_t; - -STATIC_ASSERT (sizeof (vnet_crypto_op_status_t) == 1, - "crypto op status > 1 byte"); + VNET_CRYPTO_OP_STATUS_FAIL_BAD_HMAC, +} vnet_crypto_op_status_t; typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); - vnet_crypto_op_type_t op; - vnet_crypto_op_status_t status; + vnet_crypto_op_type_t op:8; + vnet_crypto_op_status_t status:8; u8 key_len, hmac_trunc_len; u16 flags; -#define VNET_CRYPTO_OP_FLAG_INIT_IV 1 +#define VNET_CRYPTO_OP_FLAG_INIT_IV (1 << 0) +#define VNET_CRYPTO_OP_FLAG_HMAC_CHECK (1 << 1) u32 len; u8 *key; u8 *iv; |