69 if (clib_cpu_supports_x86_aes () == 0 &&
70 clib_cpu_supports_aarch64_aes () == 0)
78 "Native ISA Optimized Crypto");
82 else if (crypto_native_aes_cbc_init_icl && clib_cpu_supports_vaes ())
83 error = crypto_native_aes_cbc_init_icl (vm);
84 else if (crypto_native_aes_cbc_init_skx && clib_cpu_supports_avx512f ())
85 error = crypto_native_aes_cbc_init_skx (vm);
86 else if (crypto_native_aes_cbc_init_hsw && clib_cpu_supports_avx2 ())
87 error = crypto_native_aes_cbc_init_hsw (vm);
92 else if (crypto_native_aes_cbc_init_neon)
93 error = crypto_native_aes_cbc_init_neon (vm);
102 if (clib_cpu_supports_pclmulqdq ())
104 if (crypto_native_aes_gcm_init_icl && clib_cpu_supports_vaes ())
105 error = crypto_native_aes_gcm_init_icl (vm);
106 else if (crypto_native_aes_gcm_init_skx && clib_cpu_supports_avx512f ())
107 error = crypto_native_aes_gcm_init_skx (vm);
108 else if (crypto_native_aes_gcm_init_hsw && clib_cpu_supports_avx2 ())
109 error = crypto_native_aes_gcm_init_hsw (vm);
120 if (crypto_native_aes_gcm_init_neon)
121 error = crypto_native_aes_gcm_init_neon (vm);
143 .runs_after =
VLIB_INITS (
"vnet_crypto_init"),
147 #include <vpp/app/version.h> 151 .version = VPP_BUILD_VER,
152 .description =
"Intel IA32 Software Crypto Engine",
#define VNET_CRYPTO_KEY_TYPE_LINK
crypto_native_key_fn_t * key_fn[VNET_CRYPTO_N_ALGS]
crypto_native_per_thread_data_t * per_thread_data
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
void vnet_crypto_register_key_handler(vlib_main_t *vm, u32 engine_index, vnet_crypto_key_handler_t *key_handler)
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * crypto_native_aes_cbc_init_slm(vlib_main_t *vm)
u32 vnet_crypto_key_index_t
static void clib_mem_free_s(void *p)
clib_error_t * crypto_native_init(vlib_main_t *vm)
static_always_inline vnet_crypto_key_t * vnet_crypto_get_key(vnet_crypto_key_index_t index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * crypto_native_aes_gcm_init_slm(vlib_main_t *vm)
crypto_native_main_t crypto_native_main
static vlib_thread_main_t * vlib_get_thread_main()
#define CLIB_CACHE_LINE_BYTES
u32 vnet_crypto_register_engine(vlib_main_t *vm, char *name, int prio, char *desc)
static void crypto_native_key_handler(vlib_main_t *vm, vnet_crypto_key_op_t kop, vnet_crypto_key_index_t idx)