FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ipsecmb.c File Reference
+ Include dependency graph for ipsecmb.c:

Go to the source code of this file.

Data Structures

struct  ipsecmb_per_thread_data_t
 
struct  ipsecmb_alg_data_t
 
struct  ipsecmb_main_t_
 
struct  ipsecmb_aes_key_data_t
 

Macros

#define HMAC_MAX_BLOCK_SIZE   SHA_512_BLOCK_SIZE
 
#define EXPANDED_KEY_N_BYTES   (16 * 15)
 
#define foreach_ipsecmb_hmac_op
 
#define foreach_ipsecmb_cipher_op
 
#define foreach_ipsecmb_gcm_cipher_op
 

Typedefs

typedef struct ipsecmb_main_t_ ipsecmb_main_t
 

Functions

static_always_inline vnet_crypto_op_status_t ipsecmb_status_job (JOB_STS status)
 
static void ipsecmb_retire_hmac_job (JOB_AES_HMAC *job, u32 *n_fail, u32 digest_size)
 
static_always_inline u32 ipsecmb_ops_hmac_inline (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops, u32 block_size, u32 hash_size, u32 digest_size, JOB_HASH_ALG alg)
 
static void ipsecmb_retire_cipher_job (JOB_AES_HMAC *job, u32 *n_fail)
 
static_always_inline u32 ipsecmb_ops_aes_cipher_inline (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops, u32 key_len, JOB_CIPHER_DIRECTION direction, JOB_CIPHER_MODE cipher_mode)
 
static void ipsecmb_retire_aead_job (JOB_AES_HMAC *job, u32 *n_fail)
 
static_always_inline u32 ipsecmb_ops_chacha_poly (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops, IMB_CIPHER_DIRECTION dir)
 
static_always_inline u32 ipsecmb_ops_chacha_poly_enc (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)
 
static_always_inline u32 ipsecmb_ops_chacha_poly_dec (vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)
 
static_always_inline u32 ipsecmb_ops_chacha_poly_chained (vlib_main_t *vm, vnet_crypto_op_t *ops[], vnet_crypto_op_chunk_t *chunks, u32 n_ops, IMB_CIPHER_DIRECTION dir)
 
static_always_inline u32 ipsec_mb_ops_chacha_poly_enc_chained (vlib_main_t *vm, vnet_crypto_op_t *ops[], vnet_crypto_op_chunk_t *chunks, u32 n_ops)
 
static_always_inline u32 ipsec_mb_ops_chacha_poly_dec_chained (vlib_main_t *vm, vnet_crypto_op_t *ops[], vnet_crypto_op_chunk_t *chunks, u32 n_ops)
 
clib_error_tcrypto_ipsecmb_iv_init (ipsecmb_main_t *imbm)
 
static void crypto_ipsecmb_key_handler (vlib_main_t *vm, vnet_crypto_key_op_t kop, vnet_crypto_key_index_t idx)
 
static clib_error_tcrypto_ipsecmb_init (vlib_main_t *vm)
 
 VLIB_PLUGIN_REGISTER ()
 

Variables

static ipsecmb_main_t ipsecmb_main = { }
 
 foreach_ipsecmb_hmac_op
 
 foreach_ipsecmb_cipher_op
 
 foreach_ipsecmb_gcm_cipher_op
 

Macro Definition Documentation

◆ EXPANDED_KEY_N_BYTES

#define EXPANDED_KEY_N_BYTES   (16 * 15)

Definition at line 29 of file ipsecmb.c.

◆ foreach_ipsecmb_cipher_op

#define foreach_ipsecmb_cipher_op
Value:
_ (AES_128_CBC, 128, CBC) \
_ (AES_192_CBC, 192, CBC) \
_ (AES_256_CBC, 256, CBC) \
_ (AES_128_CTR, 128, CNTR) \
_ (AES_192_CTR, 192, CNTR) \
_ (AES_256_CTR, 256, CNTR)

Definition at line 76 of file ipsecmb.c.

◆ foreach_ipsecmb_gcm_cipher_op

#define foreach_ipsecmb_gcm_cipher_op
Value:
_(AES_128_GCM, 128) \
_(AES_192_GCM, 192) \
_(AES_256_GCM, 256)

Definition at line 87 of file ipsecmb.c.

◆ foreach_ipsecmb_hmac_op

#define foreach_ipsecmb_hmac_op
Value:
_(SHA1, SHA1, sha1, 64, 20, 20) \
_(SHA224, SHA_224, sha224, 64, 32, 28) \
_(SHA256, SHA_256, sha256, 64, 32, 32) \
_(SHA384, SHA_384, sha384, 128, 64, 48) \
_(SHA512, SHA_512, sha512, 128, 64, 64)

Definition at line 66 of file ipsecmb.c.

◆ HMAC_MAX_BLOCK_SIZE

#define HMAC_MAX_BLOCK_SIZE   SHA_512_BLOCK_SIZE

Definition at line 28 of file ipsecmb.c.

Typedef Documentation

◆ ipsecmb_main_t

Function Documentation

◆ crypto_ipsecmb_init()

static clib_error_t* crypto_ipsecmb_init ( vlib_main_t vm)
static

Definition at line 770 of file ipsecmb.c.

+ Here is the call graph for this function:

◆ crypto_ipsecmb_iv_init()

clib_error_t* crypto_ipsecmb_iv_init ( ipsecmb_main_t imbm)

Definition at line 667 of file ipsecmb.c.

+ Here is the caller graph for this function:

◆ crypto_ipsecmb_key_handler()

static void crypto_ipsecmb_key_handler ( vlib_main_t vm,
vnet_crypto_key_op_t  kop,
vnet_crypto_key_index_t  idx 
)
static

TODO: add linked alg support

Definition at line 691 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_mb_ops_chacha_poly_dec_chained()

static_always_inline u32 ipsec_mb_ops_chacha_poly_dec_chained ( vlib_main_t vm,
vnet_crypto_op_t ops[],
vnet_crypto_op_chunk_t chunks,
u32  n_ops 
)

Definition at line 658 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_mb_ops_chacha_poly_enc_chained()

static_always_inline u32 ipsec_mb_ops_chacha_poly_enc_chained ( vlib_main_t vm,
vnet_crypto_op_t ops[],
vnet_crypto_op_chunk_t chunks,
u32  n_ops 
)

Definition at line 649 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsecmb_ops_aes_cipher_inline()

static_always_inline u32 ipsecmb_ops_aes_cipher_inline ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops,
u32  key_len,
JOB_CIPHER_DIRECTION  direction,
JOB_CIPHER_MODE  cipher_mode 
)

Definition at line 216 of file ipsecmb.c.

◆ ipsecmb_ops_chacha_poly()

static_always_inline u32 ipsecmb_ops_chacha_poly ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops,
IMB_CIPHER_DIRECTION  dir 
)

Definition at line 458 of file ipsecmb.c.

+ Here is the caller graph for this function:

◆ ipsecmb_ops_chacha_poly_chained()

static_always_inline u32 ipsecmb_ops_chacha_poly_chained ( vlib_main_t vm,
vnet_crypto_op_t ops[],
vnet_crypto_op_chunk_t chunks,
u32  n_ops,
IMB_CIPHER_DIRECTION  dir 
)

Definition at line 546 of file ipsecmb.c.

+ Here is the caller graph for this function:

◆ ipsecmb_ops_chacha_poly_dec()

static_always_inline u32 ipsecmb_ops_chacha_poly_dec ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops 
)

Definition at line 539 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsecmb_ops_chacha_poly_enc()

static_always_inline u32 ipsecmb_ops_chacha_poly_enc ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops 
)

Definition at line 532 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsecmb_ops_hmac_inline()

static_always_inline u32 ipsecmb_ops_hmac_inline ( vlib_main_t vm,
vnet_crypto_op_t ops[],
u32  n_ops,
u32  block_size,
u32  hash_size,
u32  digest_size,
JOB_HASH_ALG  alg 
)

Definition at line 143 of file ipsecmb.c.

+ Here is the call graph for this function:

◆ ipsecmb_retire_aead_job()

static void ipsecmb_retire_aead_job ( JOB_AES_HMAC *  job,
u32 n_fail 
)
inlinestatic

Definition at line 430 of file ipsecmb.c.

+ Here is the call graph for this function:

◆ ipsecmb_retire_cipher_job()

static void ipsecmb_retire_cipher_job ( JOB_AES_HMAC *  job,
u32 n_fail 
)
inlinestatic

Definition at line 202 of file ipsecmb.c.

+ Here is the call graph for this function:

◆ ipsecmb_retire_hmac_job()

static void ipsecmb_retire_hmac_job ( JOB_AES_HMAC *  job,
u32 n_fail,
u32  digest_size 
)
inlinestatic

Definition at line 113 of file ipsecmb.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsecmb_status_job()

static_always_inline vnet_crypto_op_status_t ipsecmb_status_job ( JOB_STS  status)

Definition at line 93 of file ipsecmb.c.

+ Here is the caller graph for this function:

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

Variable Documentation

◆ foreach_ipsecmb_cipher_op

foreach_ipsecmb_cipher_op

Definition at line 286 of file ipsecmb.c.

◆ foreach_ipsecmb_gcm_cipher_op

foreach_ipsecmb_gcm_cipher_op

Definition at line 426 of file ipsecmb.c.

◆ foreach_ipsecmb_hmac_op

foreach_ipsecmb_hmac_op

Definition at line 198 of file ipsecmb.c.

◆ ipsecmb_main

ipsecmb_main_t ipsecmb_main = { }
static

Definition at line 61 of file ipsecmb.c.