35 ops[0]->
status = VNET_CRYPTO_OP_STATUS_FAIL_NO_HANDLER;
57 for (
i = 0;
i < n_ops;
i++)
61 if (current_op_type != opt || n_op_queue >= op_q_size)
64 op_queue, n_op_queue);
66 current_op_type = opt;
69 op_queue[n_op_queue++] = &ops[
i];
73 op_queue, n_op_queue);
189 case VNET_CRYPTO_ALG_##n: \ 197 case VNET_CRYPTO_ALG_HMAC_##n: \ 219 index = key - cm->
keys;
262 eopt = VNET_CRYPTO_OP_TYPE_AEAD_ENCRYPT;
263 dopt = VNET_CRYPTO_OP_TYPE_AEAD_DECRYPT;
267 eopt = VNET_CRYPTO_OP_TYPE_ENCRYPT;
268 dopt = VNET_CRYPTO_OP_TYPE_DECRYPT;
301 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \ 302 VNET_CRYPTO_OP_##n##_ENC, \ 303 VNET_CRYPTO_OP_##n##_DEC, s, 0); 307 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \ 308 VNET_CRYPTO_OP_##n##_ENC, \ 309 VNET_CRYPTO_OP_##n##_DEC, s, 1); 313 vnet_crypto_init_hmac_data (VNET_CRYPTO_ALG_HMAC_##n, \ 314 VNET_CRYPTO_OP_##n##_HMAC, "hmac-" s); u32 vnet_crypto_process_ops(vlib_main_t *vm, vnet_crypto_op_t ops[], u32 n_ops)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vnet_crypto_engine_t * engines
vnet_crypto_thread_t * threads
uword * alg_index_by_name
vnet_crypto_op_data_t opt_data[VNET_CRYPTO_N_OP_IDS]
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
vnet_crypto_alg_data_t * algs
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vnet_crypto_op_id_t op_by_type[VNET_CRYPTO_OP_N_TYPES]
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static void vnet_crypto_init_hmac_data(vnet_crypto_alg_t alg, vnet_crypto_op_id_t id, char *name)
#define clib_memcpy(d, s, n)
int vnet_crypto_is_set_handler(vnet_crypto_alg_t alg)
void vnet_crypto_register_key_handler(vlib_main_t *vm, u32 engine_index, vnet_crypto_key_handler_t *key_handler)
#define static_always_inline
#define VLIB_INIT_FUNCTION(x)
#define foreach_crypto_aead_alg
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define foreach_crypto_hmac_alg
u32 vnet_crypto_key_add(vlib_main_t *vm, vnet_crypto_alg_t alg, u8 *data, u16 length)
#define hash_create_string(elts, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void() vnet_crypto_key_handler_t(vlib_main_t *vm, vnet_crypto_key_op_t kop, vnet_crypto_key_index_t idx)
int vnet_crypto_set_handler(char *alg_name, char *engine)
vnet_crypto_key_handler_t * key_op_handler
void vnet_crypto_key_del(vlib_main_t *vm, vnet_crypto_key_index_t index)
#define pool_put(P, E)
Free an object E in pool P.
void vnet_crypto_register_ops_handler(vlib_main_t *vm, u32 engine_index, vnet_crypto_op_id_t opt, vnet_crypto_ops_handler_t *fn)
#define vec_free(V)
Free vector's memory (no header).
static int vnet_crypto_key_len_check(vnet_crypto_alg_t alg, u16 length)
u32() vnet_crypto_ops_handler_t(vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)
uword * engine_index_by_name
u32 vnet_crypto_key_index_t
static void vnet_crypto_init_cipher_data(vnet_crypto_alg_t alg, vnet_crypto_op_id_t eid, vnet_crypto_op_id_t did, char *name, u8 is_aead)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_crypto_op_type_t type
static_always_inline u32 vnet_crypto_process_ops_call_handler(vlib_main_t *vm, vnet_crypto_main_t *cm, vnet_crypto_op_id_t opt, vnet_crypto_op_t *ops[], u32 n_ops)
#define hash_get_mem(h, key)
vnet_crypto_ops_handler_t * ops_handlers[VNET_CRYPTO_N_OP_IDS]
vnet_crypto_op_status_t status
static vlib_thread_main_t * vlib_get_thread_main()
#define vec_foreach(var, vec)
Vector iterator.
vnet_crypto_ops_handler_t ** ops_handlers
#define CLIB_CACHE_LINE_BYTES
u32 vnet_crypto_register_engine(vlib_main_t *vm, char *name, int prio, char *desc)
vnet_crypto_main_t crypto_main
clib_error_t * vnet_crypto_init(vlib_main_t *vm)
#define foreach_crypto_cipher_alg