aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_native/main.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2024-01-11 17:37:46 +0000
committerMohammed HAWARI <momohawari@gmail.com>2024-01-12 17:37:42 +0000
commitda3771c25bc30fb15c67f36393d975c46d313b60 (patch)
tree3d6f28b39d1eaa6320c7402f319dd3b6c1ba914f /src/plugins/crypto_native/main.c
parent9caef2a3518ee9a453adbb748a9f4799a5fbb56b (diff)
crypto-native: add AES-CTR
Type: feature Change-Id: Iab84226043d8042a99a507767b75e9d4a89cc5c6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/crypto_native/main.c')
-rw-r--r--src/plugins/crypto_native/main.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/plugins/crypto_native/main.c b/src/plugins/crypto_native/main.c
index 718356c745f..8a59be319b9 100644
--- a/src/plugins/crypto_native/main.c
+++ b/src/plugins/crypto_native/main.c
@@ -97,6 +97,31 @@ crypto_native_init (vlib_main_t * vm)
if (error)
return error;
+ if (0)
+ ;
+#if __x86_64__
+ else if (crypto_native_aes_ctr_init_icl && clib_cpu_supports_vaes () &&
+ clib_cpu_supports_avx512f ())
+ error = crypto_native_aes_ctr_init_icl (vm);
+ else if (crypto_native_aes_ctr_init_adl && clib_cpu_supports_vaes ())
+ error = crypto_native_aes_ctr_init_adl (vm);
+ else if (crypto_native_aes_ctr_init_skx && clib_cpu_supports_avx512f ())
+ error = crypto_native_aes_ctr_init_skx (vm);
+ else if (crypto_native_aes_ctr_init_hsw && clib_cpu_supports_avx2 ())
+ error = crypto_native_aes_ctr_init_hsw (vm);
+ else if (crypto_native_aes_ctr_init_slm)
+ error = crypto_native_aes_ctr_init_slm (vm);
+#endif
+#if __aarch64__
+ else if (crypto_native_aes_ctr_init_neon)
+ error = crypto_native_aes_ctr_init_neon (vm);
+#endif
+ else
+ error = clib_error_return (0, "No AES CTR implemenation available");
+
+ if (error)
+ return error;
+
#if __x86_64__
if (clib_cpu_supports_pclmulqdq ())
{
@@ -133,26 +158,14 @@ crypto_native_init (vlib_main_t * vm)
return 0;
}
-/* *INDENT-OFF* */
VLIB_INIT_FUNCTION (crypto_native_init) =
{
.runs_after = VLIB_INITS ("vnet_crypto_init"),
};
-/* *INDENT-ON* */
#include <vpp/app/version.h>
-/* *INDENT-OFF* */
VLIB_PLUGIN_REGISTER () = {
.version = VPP_BUILD_VER,
- .description = "Intel IA32 Software Crypto Engine",
+ .description = "Native Crypto Engine",
};
-/* *INDENT-ON* */
-
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */