FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
crypto.h File Reference
+ Include dependency graph for crypto.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vnet_crypto_alg_data_t
 
struct  vnet_crypto_op_t
 
struct  vnet_crypto_op_data_t
 
struct  vnet_crypto_thread_t
 
struct  vnet_crypto_engine_t
 
struct  vnet_crypto_main_t
 

Macros

#define VNET_CRYPTO_RING_SIZE   512
 
#define foreach_crypto_cipher_alg
 
#define foreach_crypto_aead_alg
 
#define foreach_crypto_hmac_alg
 
#define foreach_crypto_op_type
 
#define foreach_crypto_op_status
 
#define VNET_CRYPTO_OP_FLAG_INIT_IV   (1 << 0)
 
#define VNET_CRYPTO_OP_FLAG_HMAC_CHECK   (1 << 1)
 

Typedefs

typedef u32() vnet_crypto_ops_handler_t(vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)
 

Enumerations

enum  vnet_crypto_op_type_t { VNET_CRYPTO_OP_N_TYPES }
 
enum  vnet_crypto_op_status_t { VNET_CRYPTO_OP_N_STATUS }
 
enum  vnet_crypto_alg_t { VNET_CRYPTO_N_ALGS }
 
enum  vnet_crypto_op_id_t { VNET_CRYPTO_OP_NONE = 0, VNET_CRYPTO_N_OP_IDS }
 

Functions

u32 vnet_crypto_register_engine (vlib_main_t *vm, char *name, int prio, char *desc)
 
vlib_error_tvnet_crypto_register_ops_handler (vlib_main_t *vm, u32 provider_index, vnet_crypto_op_id_t opt, vnet_crypto_ops_handler_t *f)
 
u32 vnet_crypto_submit_ops (vlib_main_t *vm, vnet_crypto_op_t **jobs, u32 n_jobs)
 
u32 vnet_crypto_process_ops (vlib_main_t *vm, vnet_crypto_op_t ops[], u32 n_ops)
 
int vnet_crypto_set_handler (char *ops_handler_name, char *engine)
 
static_always_inline void vnet_crypto_op_init (vnet_crypto_op_t *op, vnet_crypto_op_id_t type)
 
static_always_inline vnet_crypto_op_type_t vnet_crypto_get_op_type (vnet_crypto_op_id_t id)
 

Variables

vnet_crypto_main_t crypto_main
 
format_function_t format_vnet_crypto_alg
 
format_function_t format_vnet_crypto_engine
 
format_function_t format_vnet_crypto_op
 
format_function_t format_vnet_crypto_op_type
 
format_function_t format_vnet_crypto_op_status
 

Macro Definition Documentation

◆ foreach_crypto_aead_alg

#define foreach_crypto_aead_alg
Value:
_(AES_128_GCM, "aes-128-gcm") \
_(AES_192_GCM, "aes-192-gcm") \
_(AES_256_GCM, "aes-256-gcm")

Definition at line 30 of file crypto.h.

◆ foreach_crypto_cipher_alg

#define foreach_crypto_cipher_alg
Value:
_(DES_CBC, "des-cbc") \
_(3DES_CBC, "3des-cbc") \
_(AES_128_CBC, "aes-128-cbc") \
_(AES_192_CBC, "aes-192-cbc") \
_(AES_256_CBC, "aes-256-cbc")

Definition at line 23 of file crypto.h.

◆ foreach_crypto_hmac_alg

#define foreach_crypto_hmac_alg
Value:
_(MD5, "md5") \
_(SHA1, "sha-1") \
_(SHA224, "sha-224") \
_(SHA256, "sha-256") \
_(SHA384, "sha-384") \
_(SHA512, "sha-512")

Definition at line 35 of file crypto.h.

◆ foreach_crypto_op_status

#define foreach_crypto_op_status
Value:
_(PENDING, "pending") \
_(COMPLETED, "completed") \
_(FAIL_NO_HANDLER, "no-handler") \
_(FAIL_BAD_HMAC, "bad-hmac") \
_(FAIL_DECRYPT, "decrypt-fail")

Definition at line 59 of file crypto.h.

◆ foreach_crypto_op_type

#define foreach_crypto_op_type
Value:
_(ENCRYPT, "encrypt") \
_(DECRYPT, "decrypt") \
_(AEAD_ENCRYPT, "aead-encrypt") \
_(AEAD_DECRYPT, "aead-decrypt") \
_(HMAC, "hmac")

Definition at line 44 of file crypto.h.

◆ VNET_CRYPTO_OP_FLAG_HMAC_CHECK

#define VNET_CRYPTO_OP_FLAG_HMAC_CHECK   (1 << 1)

Definition at line 114 of file crypto.h.

◆ VNET_CRYPTO_OP_FLAG_INIT_IV

#define VNET_CRYPTO_OP_FLAG_INIT_IV   (1 << 0)

Definition at line 113 of file crypto.h.

◆ VNET_CRYPTO_RING_SIZE

#define VNET_CRYPTO_RING_SIZE   512

Definition at line 19 of file crypto.h.

Typedef Documentation

◆ vnet_crypto_ops_handler_t

typedef u32() vnet_crypto_ops_handler_t(vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)

Definition at line 141 of file crypto.h.

Enumeration Type Documentation

◆ vnet_crypto_alg_t

Enumerator
VNET_CRYPTO_N_ALGS 

Definition at line 75 of file crypto.h.

◆ vnet_crypto_op_id_t

Enumerator
VNET_CRYPTO_OP_NONE 
VNET_CRYPTO_N_OP_IDS 

Definition at line 87 of file crypto.h.

◆ vnet_crypto_op_status_t

Enumerator
VNET_CRYPTO_OP_N_STATUS 

Definition at line 66 of file crypto.h.

◆ vnet_crypto_op_type_t

Enumerator
VNET_CRYPTO_OP_N_TYPES 

Definition at line 51 of file crypto.h.

Function Documentation

◆ vnet_crypto_get_op_type()

Definition at line 199 of file crypto.h.

◆ vnet_crypto_op_init()

static_always_inline void vnet_crypto_op_init ( vnet_crypto_op_t op,
vnet_crypto_op_id_t  type 
)

Definition at line 190 of file crypto.h.

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

◆ vnet_crypto_process_ops()

u32 vnet_crypto_process_ops ( vlib_main_t vm,
vnet_crypto_op_t  ops[],
u32  n_ops 
)

Definition at line 46 of file crypto.c.

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

◆ vnet_crypto_register_engine()

u32 vnet_crypto_register_engine ( vlib_main_t vm,
char *  name,
int  prio,
char *  desc 
)

Definition at line 78 of file crypto.c.

+ Here is the caller graph for this function:

◆ vnet_crypto_register_ops_handler()

vlib_error_t* vnet_crypto_register_ops_handler ( vlib_main_t vm,
u32  provider_index,
vnet_crypto_op_id_t  opt,
vnet_crypto_ops_handler_t f 
)

Definition at line 133 of file crypto.c.

◆ vnet_crypto_set_handler()

int vnet_crypto_set_handler ( char *  ops_handler_name,
char *  engine 
)

Definition at line 95 of file crypto.c.

+ Here is the caller graph for this function:

◆ vnet_crypto_submit_ops()

u32 vnet_crypto_submit_ops ( vlib_main_t vm,
vnet_crypto_op_t **  jobs,
u32  n_jobs 
)

Variable Documentation

◆ crypto_main

vnet_crypto_main_t crypto_main

Definition at line 20 of file crypto.c.

◆ format_vnet_crypto_alg

format_function_t format_vnet_crypto_alg

Definition at line 183 of file crypto.h.

◆ format_vnet_crypto_engine

format_function_t format_vnet_crypto_engine

Definition at line 184 of file crypto.h.

◆ format_vnet_crypto_op

format_function_t format_vnet_crypto_op

Definition at line 185 of file crypto.h.

◆ format_vnet_crypto_op_status

format_function_t format_vnet_crypto_op_status

Definition at line 187 of file crypto.h.

◆ format_vnet_crypto_op_type

format_function_t format_vnet_crypto_op_type

Definition at line 186 of file crypto.h.