diff options
author | Damjan Marion <damarion@cisco.com> | 2019-05-22 16:30:01 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2019-06-03 14:11:34 +0200 |
commit | dd2423ef74b37711aec413603df21230f7823333 (patch) | |
tree | c14cb1a63f8f9984cee550de270b0acf46b9cfaf /src/plugins/crypto_ia32/main.c | |
parent | 365e724ffe5c5420b338b20c06a6c73171f39bce (diff) |
crypto_ia32: native AES-GCM implementation
Change-Id: I006a150577e897731649f21908b4789e2eb485c3
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/crypto_ia32/main.c')
-rw-r--r-- | src/plugins/crypto_ia32/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/crypto_ia32/main.c b/src/plugins/crypto_ia32/main.c index b31c9019495..cca5fb4cf64 100644 --- a/src/plugins/crypto_ia32/main.c +++ b/src/plugins/crypto_ia32/main.c @@ -86,6 +86,19 @@ crypto_ia32_init (vlib_main_t * vm) if (error) goto error; + if (clib_cpu_supports_pclmulqdq ()) + { + if (clib_cpu_supports_avx512f ()) + error = crypto_ia32_aesni_gcm_init_avx512 (vm); + else if (clib_cpu_supports_avx2 ()) + error = crypto_ia32_aesni_gcm_init_avx2 (vm); + else + error = crypto_ia32_aesni_gcm_init_sse42 (vm); + + if (error) + goto error; + } + vnet_crypto_register_key_handler (vm, cm->crypto_engine_index, crypto_ia32_key_handler); |