2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 #include <vlib/vlib.h>
18 #include <vnet/crypto/crypto.h>
20 vnet_crypto_main_t crypto_main;
22 static_always_inline void
23 crypto_set_op_status (vnet_crypto_op_t * ops[], u32 n_ops, int status)
27 ops[0]->status = status;
32 static_always_inline u32
33 vnet_crypto_process_ops_call_handler (vlib_main_t * vm,
34 vnet_crypto_main_t * cm,
35 vnet_crypto_op_id_t opt,
36 vnet_crypto_op_t * ops[],
37 vnet_crypto_op_chunk_t * chunks,
47 if (cm->chained_ops_handlers[opt] == 0)
48 crypto_set_op_status (ops, n_ops,
49 VNET_CRYPTO_OP_STATUS_FAIL_NO_HANDLER);
51 rv = (cm->chained_ops_handlers[opt]) (vm, ops, chunks, n_ops);
55 if (cm->ops_handlers[opt] == 0)
56 crypto_set_op_status (ops, n_ops,
57 VNET_CRYPTO_OP_STATUS_FAIL_NO_HANDLER);
59 rv = (cm->ops_handlers[opt]) (vm, ops, n_ops);
64 static_always_inline u32
65 vnet_crypto_process_ops_inline (vlib_main_t * vm, vnet_crypto_op_t ops[],
66 vnet_crypto_op_chunk_t * chunks, u32 n_ops)
68 vnet_crypto_main_t *cm = &crypto_main;
69 const int op_q_size = VLIB_FRAME_SIZE;
70 vnet_crypto_op_t *op_queue[op_q_size];
71 vnet_crypto_op_id_t opt, current_op_type = ~0;
77 for (i = 0; i < n_ops; i++)
81 if (current_op_type != opt || n_op_queue >= op_q_size)
83 rv += vnet_crypto_process_ops_call_handler (vm, cm, current_op_type,
87 current_op_type = opt;
90 op_queue[n_op_queue++] = &ops[i];
93 rv += vnet_crypto_process_ops_call_handler (vm, cm, current_op_type,
94 op_queue, chunks, n_op_queue);
99 vnet_crypto_process_ops (vlib_main_t * vm, vnet_crypto_op_t ops[], u32 n_ops)
101 return vnet_crypto_process_ops_inline (vm, ops, 0, n_ops);
105 vnet_crypto_process_chained_ops (vlib_main_t * vm, vnet_crypto_op_t ops[],
106 vnet_crypto_op_chunk_t * chunks, u32 n_ops)
108 return vnet_crypto_process_ops_inline (vm, ops, chunks, n_ops);
112 vnet_crypto_register_engine (vlib_main_t * vm, char *name, int prio,
115 vnet_crypto_main_t *cm = &crypto_main;
116 vnet_crypto_engine_t *p;
118 vec_add2 (cm->engines, p, 1);
123 hash_set_mem (cm->engine_index_by_name, p->name, p - cm->engines);
125 return p - cm->engines;
128 static_always_inline void
129 crypto_set_active_engine (vnet_crypto_op_data_t * od,
130 vnet_crypto_op_id_t id, u32 ei,
131 crypto_op_class_type_t oct)
133 vnet_crypto_main_t *cm = &crypto_main;
134 vnet_crypto_engine_t *ce = vec_elt_at_index (cm->engines, ei);
136 if (oct == CRYPTO_OP_BOTH || oct == CRYPTO_OP_CHAINED)
138 if (ce->chained_ops_handlers[id])
140 od->active_engine_index_chained = ei;
141 cm->chained_ops_handlers[id] = ce->chained_ops_handlers[id];
145 if (oct == CRYPTO_OP_BOTH || oct == CRYPTO_OP_SIMPLE)
147 if (ce->ops_handlers[id])
149 od->active_engine_index_simple = ei;
150 cm->ops_handlers[id] = ce->ops_handlers[id];
156 vnet_crypto_set_handler2 (char *alg_name, char *engine,
157 crypto_op_class_type_t oct)
160 vnet_crypto_main_t *cm = &crypto_main;
161 vnet_crypto_alg_data_t *ad;
164 p = hash_get_mem (cm->alg_index_by_name, alg_name);
168 ad = vec_elt_at_index (cm->algs, p[0]);
170 p = hash_get_mem (cm->engine_index_by_name, engine);
174 for (i = 0; i < VNET_CRYPTO_OP_N_TYPES; i++)
176 vnet_crypto_op_data_t *od;
177 vnet_crypto_op_id_t id = ad->op_by_type[i];
181 od = cm->opt_data + id;
182 crypto_set_active_engine (od, id, p[0], oct);
189 vnet_crypto_is_set_handler (vnet_crypto_alg_t alg)
191 vnet_crypto_main_t *cm = &crypto_main;
192 vnet_crypto_op_id_t opt = 0;
195 if (alg >= vec_len (cm->algs))
198 for (i = 0; i < VNET_CRYPTO_OP_N_TYPES; i++)
199 if ((opt = cm->algs[alg].op_by_type[i]) != 0)
202 if (opt >= vec_len (cm->ops_handlers))
205 return NULL != cm->ops_handlers[opt];
209 vnet_crypto_register_ops_handler_inline (vlib_main_t * vm, u32 engine_index,
210 vnet_crypto_op_id_t opt,
211 vnet_crypto_ops_handler_t * fn,
212 vnet_crypto_chained_ops_handler_t *
215 vnet_crypto_main_t *cm = &crypto_main;
216 vnet_crypto_engine_t *ae, *e = vec_elt_at_index (cm->engines, engine_index);
217 vnet_crypto_op_data_t *otd = cm->opt_data + opt;
218 vec_validate_aligned (cm->ops_handlers, VNET_CRYPTO_N_OP_IDS - 1,
219 CLIB_CACHE_LINE_BYTES);
220 vec_validate_aligned (cm->chained_ops_handlers, VNET_CRYPTO_N_OP_IDS - 1,
221 CLIB_CACHE_LINE_BYTES);
225 e->ops_handlers[opt] = fn;
226 if (otd->active_engine_index_simple == ~0)
228 otd->active_engine_index_simple = engine_index;
229 cm->ops_handlers[opt] = fn;
232 ae = vec_elt_at_index (cm->engines, otd->active_engine_index_simple);
233 if (ae->priority < e->priority)
234 crypto_set_active_engine (otd, opt, engine_index, CRYPTO_OP_SIMPLE);
239 e->chained_ops_handlers[opt] = cfn;
240 if (otd->active_engine_index_chained == ~0)
242 otd->active_engine_index_chained = engine_index;
243 cm->chained_ops_handlers[opt] = cfn;
246 ae = vec_elt_at_index (cm->engines, otd->active_engine_index_chained);
247 if (ae->priority < e->priority)
248 crypto_set_active_engine (otd, opt, engine_index, CRYPTO_OP_CHAINED);
255 vnet_crypto_register_ops_handler (vlib_main_t * vm, u32 engine_index,
256 vnet_crypto_op_id_t opt,
257 vnet_crypto_ops_handler_t * fn)
259 vnet_crypto_register_ops_handler_inline (vm, engine_index, opt, fn, 0);
263 vnet_crypto_register_chained_ops_handler (vlib_main_t * vm, u32 engine_index,
264 vnet_crypto_op_id_t opt,
265 vnet_crypto_chained_ops_handler_t *
268 vnet_crypto_register_ops_handler_inline (vm, engine_index, opt, 0, fn);
272 vnet_crypto_register_ops_handlers (vlib_main_t * vm, u32 engine_index,
273 vnet_crypto_op_id_t opt,
274 vnet_crypto_ops_handler_t * fn,
275 vnet_crypto_chained_ops_handler_t * cfn)
277 vnet_crypto_register_ops_handler_inline (vm, engine_index, opt, fn, cfn);
281 vnet_crypto_register_enqueue_handler (vlib_main_t *vm, u32 engine_index,
282 vnet_crypto_async_op_id_t opt,
283 vnet_crypto_frame_enqueue_t *enqueue_hdl)
285 vnet_crypto_main_t *cm = &crypto_main;
286 vnet_crypto_engine_t *ae, *e = vec_elt_at_index (cm->engines, engine_index);
287 vnet_crypto_async_op_data_t *otd = cm->async_opt_data + opt;
288 vec_validate_aligned (cm->enqueue_handlers, VNET_CRYPTO_ASYNC_OP_N_IDS,
289 CLIB_CACHE_LINE_BYTES);
294 e->enqueue_handlers[opt] = enqueue_hdl;
295 if (otd->active_engine_index_async == ~0)
297 otd->active_engine_index_async = engine_index;
298 cm->enqueue_handlers[opt] = enqueue_hdl;
301 ae = vec_elt_at_index (cm->engines, otd->active_engine_index_async);
302 if (ae->priority <= e->priority)
304 otd->active_engine_index_async = engine_index;
305 cm->enqueue_handlers[opt] = enqueue_hdl;
312 engine_index_cmp (void *v1, void *v2)
325 vnet_crypto_update_cm_dequeue_handlers (void)
327 vnet_crypto_main_t *cm = &crypto_main;
328 vnet_crypto_async_op_data_t *otd;
329 vnet_crypto_engine_t *e;
330 u32 *active_engines = 0, *ei, last_ei = ~0, i;
332 vec_reset_length (cm->dequeue_handlers);
334 for (i = 0; i < VNET_CRYPTO_ASYNC_OP_N_IDS; i++)
336 otd = cm->async_opt_data + i;
337 if (otd->active_engine_index_async == ~0)
339 e = cm->engines + otd->active_engine_index_async;
340 if (!e->dequeue_handler)
342 vec_add1 (active_engines, otd->active_engine_index_async);
345 vec_sort_with_function (active_engines, engine_index_cmp);
347 vec_foreach (ei, active_engines)
349 if (ei[0] == last_ei)
354 e = cm->engines + ei[0];
355 vec_add1 (cm->dequeue_handlers, e->dequeue_handler);
359 vec_free (active_engines);
363 vnet_crypto_register_dequeue_handler (vlib_main_t *vm, u32 engine_index,
364 vnet_crypto_frame_dequeue_t *deq_fn)
366 vnet_crypto_main_t *cm = &crypto_main;
367 vnet_crypto_engine_t *e = vec_elt_at_index (cm->engines, engine_index);
372 e->dequeue_handler = deq_fn;
374 vnet_crypto_update_cm_dequeue_handlers ();
380 vnet_crypto_register_key_handler (vlib_main_t * vm, u32 engine_index,
381 vnet_crypto_key_handler_t * key_handler)
383 vnet_crypto_main_t *cm = &crypto_main;
384 vnet_crypto_engine_t *e = vec_elt_at_index (cm->engines, engine_index);
385 e->key_op_handler = key_handler;
390 vnet_crypto_key_len_check (vnet_crypto_alg_t alg, u16 length)
394 case VNET_CRYPTO_N_ALGS:
396 case VNET_CRYPTO_ALG_NONE:
400 case VNET_CRYPTO_ALG_##n: \
404 foreach_crypto_cipher_alg foreach_crypto_aead_alg
406 /* HMAC allows any key length */
408 case VNET_CRYPTO_ALG_HMAC_##n: \
410 foreach_crypto_hmac_alg
414 case VNET_CRYPTO_ALG_HASH_##n: \
416 foreach_crypto_hash_alg
424 vnet_crypto_key_add (vlib_main_t * vm, vnet_crypto_alg_t alg, u8 * data,
428 vnet_crypto_main_t *cm = &crypto_main;
429 vnet_crypto_engine_t *engine;
430 vnet_crypto_key_t *key;
432 u8 need_barrier_sync = 0;
434 if (!vnet_crypto_key_len_check (alg, length))
437 need_barrier_sync = pool_get_will_expand (cm->keys);
438 /* If the cm->keys will expand, stop the parade. */
439 if (need_barrier_sync)
440 vlib_worker_thread_barrier_sync (vm);
442 pool_get_zero (cm->keys, key);
444 if (need_barrier_sync)
445 vlib_worker_thread_barrier_release (vm);
447 index = key - cm->keys;
448 key->type = VNET_CRYPTO_KEY_TYPE_DATA;
450 vec_validate_aligned (key->data, length - 1, CLIB_CACHE_LINE_BYTES);
451 clib_memcpy (key->data, data, length);
453 vec_foreach (engine, cm->engines)
454 if (engine->key_op_handler)
455 engine->key_op_handler (vm, VNET_CRYPTO_KEY_OP_ADD, index);
461 vnet_crypto_key_del (vlib_main_t * vm, vnet_crypto_key_index_t index)
463 vnet_crypto_main_t *cm = &crypto_main;
464 vnet_crypto_engine_t *engine;
465 vnet_crypto_key_t *key = pool_elt_at_index (cm->keys, index);
468 vec_foreach (engine, cm->engines)
469 if (engine->key_op_handler)
470 engine->key_op_handler (vm, VNET_CRYPTO_KEY_OP_DEL, index);
473 if (key->type == VNET_CRYPTO_KEY_TYPE_DATA)
475 clib_memset (key->data, 0xfe, vec_len (key->data));
476 vec_free (key->data);
478 else if (key->type == VNET_CRYPTO_KEY_TYPE_LINK)
480 key->index_crypto = key->index_integ = ~0;
483 pool_put (cm->keys, key);
486 vnet_crypto_async_alg_t
487 vnet_crypto_link_algs (vnet_crypto_alg_t crypto_alg,
488 vnet_crypto_alg_t integ_alg)
490 #define _(c, h, s, k ,d) \
491 if (crypto_alg == VNET_CRYPTO_ALG_##c && \
492 integ_alg == VNET_CRYPTO_ALG_HMAC_##h) \
493 return VNET_CRYPTO_ALG_##c##_##h##_TAG##d;
494 foreach_crypto_link_async_alg
500 vnet_crypto_key_add_linked (vlib_main_t * vm,
501 vnet_crypto_key_index_t index_crypto,
502 vnet_crypto_key_index_t index_integ)
505 vnet_crypto_main_t *cm = &crypto_main;
506 vnet_crypto_engine_t *engine;
507 vnet_crypto_key_t *key_crypto, *key_integ, *key;
508 vnet_crypto_async_alg_t linked_alg;
510 key_crypto = pool_elt_at_index (cm->keys, index_crypto);
511 key_integ = pool_elt_at_index (cm->keys, index_integ);
513 linked_alg = vnet_crypto_link_algs (key_crypto->alg, key_integ->alg);
514 if (linked_alg == ~0)
517 pool_get_zero (cm->keys, key);
518 index = key - cm->keys;
519 key->type = VNET_CRYPTO_KEY_TYPE_LINK;
520 key->index_crypto = index_crypto;
521 key->index_integ = index_integ;
522 key->async_alg = linked_alg;
525 vec_foreach (engine, cm->engines)
526 if (engine->key_op_handler)
527 engine->key_op_handler (vm, VNET_CRYPTO_KEY_OP_ADD, index);
533 static_always_inline void
534 crypto_set_active_async_engine (vnet_crypto_async_op_data_t * od,
535 vnet_crypto_async_op_id_t id, u32 ei)
537 vnet_crypto_main_t *cm = &crypto_main;
538 vnet_crypto_engine_t *ce = vec_elt_at_index (cm->engines, ei);
540 if (ce->enqueue_handlers[id] && ce->dequeue_handler)
542 od->active_engine_index_async = ei;
543 cm->enqueue_handlers[id] = ce->enqueue_handlers[id];
548 vnet_crypto_set_async_handler2 (char *alg_name, char *engine)
551 vnet_crypto_main_t *cm = &crypto_main;
552 vnet_crypto_async_alg_data_t *ad;
555 p = hash_get_mem (cm->async_alg_index_by_name, alg_name);
559 ad = vec_elt_at_index (cm->async_algs, p[0]);
561 p = hash_get_mem (cm->engine_index_by_name, engine);
565 for (i = 0; i < VNET_CRYPTO_ASYNC_OP_N_TYPES; i++)
567 vnet_crypto_async_op_data_t *od;
568 vnet_crypto_async_op_id_t id = ad->op_by_type[i];
572 od = cm->async_opt_data + id;
573 crypto_set_active_async_engine (od, id, p[0]);
576 vnet_crypto_update_cm_dequeue_handlers ();
582 vnet_crypto_register_post_node (vlib_main_t * vm, char *post_node_name)
584 vnet_crypto_main_t *cm = &crypto_main;
585 vnet_crypto_async_next_node_t *nn = 0;
586 vlib_node_t *cc, *pn;
587 uword index = vec_len (cm->next_nodes);
589 pn = vlib_get_node_by_name (vm, (u8 *) post_node_name);
594 vec_foreach (nn, cm->next_nodes)
596 if (nn->node_idx == pn->index)
601 vec_validate (cm->next_nodes, index);
602 nn = vec_elt_at_index (cm->next_nodes, index);
604 cc = vlib_get_node_by_name (vm, (u8 *) "crypto-dispatch");
605 nn->next_idx = vlib_node_add_named_next (vm, cc->index, post_node_name);
606 nn->node_idx = pn->index;
612 vnet_crypto_set_async_dispatch (u8 mode, u8 adaptive)
614 vlib_thread_main_t *tm = vlib_get_thread_main ();
615 u32 i, node_index = crypto_main.crypto_node_index;
616 vlib_node_state_t state =
617 mode ? VLIB_NODE_STATE_INTERRUPT : VLIB_NODE_STATE_POLLING;
619 for (i = vlib_num_workers () > 0; i < tm->n_vlib_mains; i++)
621 vlib_main_t *ovm = vlib_get_main_by_index (i);
622 vlib_node_set_state (ovm, node_index, state);
623 vlib_node_set_flag (ovm, node_index, VLIB_NODE_FLAG_ADAPTIVE_MODE,
629 vnet_crypto_is_set_async_handler (vnet_crypto_async_op_id_t op)
631 vnet_crypto_main_t *cm = &crypto_main;
633 return (op < vec_len (cm->enqueue_handlers) &&
634 NULL != cm->enqueue_handlers[op]);
638 vnet_crypto_init_cipher_data (vnet_crypto_alg_t alg, vnet_crypto_op_id_t eid,
639 vnet_crypto_op_id_t did, char *name, u8 is_aead)
641 vnet_crypto_op_type_t eopt, dopt;
642 vnet_crypto_main_t *cm = &crypto_main;
644 cm->algs[alg].name = name;
645 cm->opt_data[eid].alg = cm->opt_data[did].alg = alg;
646 cm->opt_data[eid].active_engine_index_simple = ~0;
647 cm->opt_data[did].active_engine_index_simple = ~0;
648 cm->opt_data[eid].active_engine_index_chained = ~0;
649 cm->opt_data[did].active_engine_index_chained = ~0;
652 eopt = VNET_CRYPTO_OP_TYPE_AEAD_ENCRYPT;
653 dopt = VNET_CRYPTO_OP_TYPE_AEAD_DECRYPT;
657 eopt = VNET_CRYPTO_OP_TYPE_ENCRYPT;
658 dopt = VNET_CRYPTO_OP_TYPE_DECRYPT;
660 cm->opt_data[eid].type = eopt;
661 cm->opt_data[did].type = dopt;
662 cm->algs[alg].op_by_type[eopt] = eid;
663 cm->algs[alg].op_by_type[dopt] = did;
664 hash_set_mem (cm->alg_index_by_name, name, alg);
668 vnet_crypto_init_hash_data (vnet_crypto_alg_t alg, vnet_crypto_op_id_t id,
671 vnet_crypto_main_t *cm = &crypto_main;
672 cm->algs[alg].name = name;
673 cm->algs[alg].op_by_type[VNET_CRYPTO_OP_TYPE_HASH] = id;
674 cm->opt_data[id].alg = alg;
675 cm->opt_data[id].active_engine_index_simple = ~0;
676 cm->opt_data[id].active_engine_index_chained = ~0;
677 cm->opt_data[id].type = VNET_CRYPTO_OP_TYPE_HASH;
678 hash_set_mem (cm->alg_index_by_name, name, alg);
682 vnet_crypto_init_hmac_data (vnet_crypto_alg_t alg,
683 vnet_crypto_op_id_t id, char *name)
685 vnet_crypto_main_t *cm = &crypto_main;
686 cm->algs[alg].name = name;
687 cm->algs[alg].op_by_type[VNET_CRYPTO_OP_TYPE_HMAC] = id;
688 cm->opt_data[id].alg = alg;
689 cm->opt_data[id].active_engine_index_simple = ~0;
690 cm->opt_data[id].active_engine_index_chained = ~0;
691 cm->opt_data[id].type = VNET_CRYPTO_OP_TYPE_HMAC;
692 hash_set_mem (cm->alg_index_by_name, name, alg);
696 vnet_crypto_init_async_data (vnet_crypto_async_alg_t alg,
697 vnet_crypto_async_op_id_t eid,
698 vnet_crypto_async_op_id_t did, char *name)
700 vnet_crypto_main_t *cm = &crypto_main;
702 cm->async_algs[alg].name = name;
703 cm->async_algs[alg].op_by_type[VNET_CRYPTO_ASYNC_OP_TYPE_ENCRYPT] = eid;
704 cm->async_algs[alg].op_by_type[VNET_CRYPTO_ASYNC_OP_TYPE_DECRYPT] = did;
705 cm->async_opt_data[eid].type = VNET_CRYPTO_ASYNC_OP_TYPE_ENCRYPT;
706 cm->async_opt_data[eid].alg = alg;
707 cm->async_opt_data[eid].active_engine_index_async = ~0;
708 cm->async_opt_data[eid].active_engine_index_async = ~0;
709 cm->async_opt_data[did].type = VNET_CRYPTO_ASYNC_OP_TYPE_DECRYPT;
710 cm->async_opt_data[did].alg = alg;
711 cm->async_opt_data[did].active_engine_index_async = ~0;
712 cm->async_opt_data[did].active_engine_index_async = ~0;
713 hash_set_mem (cm->async_alg_index_by_name, name, alg);
717 vnet_crypto_init (vlib_main_t * vm)
719 vnet_crypto_main_t *cm = &crypto_main;
720 vlib_thread_main_t *tm = vlib_get_thread_main ();
721 vnet_crypto_thread_t *ct = 0;
723 cm->engine_index_by_name = hash_create_string ( /* size */ 0,
725 cm->alg_index_by_name = hash_create_string (0, sizeof (uword));
726 cm->async_alg_index_by_name = hash_create_string (0, sizeof (uword));
727 vec_validate_aligned (cm->threads, tm->n_vlib_mains, CLIB_CACHE_LINE_BYTES);
728 vec_foreach (ct, cm->threads)
729 pool_init_fixed (ct->frame_pool, VNET_CRYPTO_FRAME_POOL_SIZE);
730 vec_validate (cm->algs, VNET_CRYPTO_N_ALGS);
731 vec_validate (cm->async_algs, VNET_CRYPTO_N_ASYNC_ALGS);
734 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \
735 VNET_CRYPTO_OP_##n##_ENC, \
736 VNET_CRYPTO_OP_##n##_DEC, s, 0);
737 foreach_crypto_cipher_alg;
740 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \
741 VNET_CRYPTO_OP_##n##_ENC, \
742 VNET_CRYPTO_OP_##n##_DEC, s, 1);
743 foreach_crypto_aead_alg;
746 vnet_crypto_init_hmac_data (VNET_CRYPTO_ALG_HMAC_##n, \
747 VNET_CRYPTO_OP_##n##_HMAC, "hmac-" s);
748 foreach_crypto_hmac_alg;
751 vnet_crypto_init_hash_data (VNET_CRYPTO_ALG_HASH_##n, \
752 VNET_CRYPTO_OP_##n##_HASH, s);
753 foreach_crypto_hash_alg;
755 #define _(n, s, k, t, a) \
756 vnet_crypto_init_async_data (VNET_CRYPTO_ALG_##n##_TAG##t##_AAD##a, \
757 VNET_CRYPTO_OP_##n##_TAG##t##_AAD##a##_ENC, \
758 VNET_CRYPTO_OP_##n##_TAG##t##_AAD##a##_DEC, \
760 foreach_crypto_aead_async_alg
762 #define _(c, h, s, k ,d) \
763 vnet_crypto_init_async_data (VNET_CRYPTO_ALG_##c##_##h##_TAG##d, \
764 VNET_CRYPTO_OP_##c##_##h##_TAG##d##_ENC, \
765 VNET_CRYPTO_OP_##c##_##h##_TAG##d##_DEC, \
767 foreach_crypto_link_async_alg
769 cm->crypto_node_index =
770 vlib_get_node_by_name (vm, (u8 *) "crypto-dispatch")->index;
775 VLIB_INIT_FUNCTION (vnet_crypto_init);
778 * fd.io coding-style-patch-verification: ON
781 * eval: (c-set-style "gnu")