From e84e9d708e0a7571bc24ae2f443462ed8cddbb84 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 13 Feb 2020 13:11:02 +0100 Subject: crypto-native: refactor CBC code Type: refactor Change-Id: I61e25942de318d03fb3d75689259709d687479bc Signed-off-by: Damjan Marion --- src/plugins/crypto_native/aes.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/plugins/crypto_native/aes.h') diff --git a/src/plugins/crypto_native/aes.h b/src/plugins/crypto_native/aes.h index b914088e94d..c2c22c6bd16 100644 --- a/src/plugins/crypto_native/aes.h +++ b/src/plugins/crypto_native/aes.h @@ -48,6 +48,32 @@ aes_enc_round (u8x16 a, u8x16 k) #endif } +#if defined (__VAES__) +static_always_inline u8x64 +aes_enc_round_x4 (u8x64 a, u8x64 k) +{ + return (u8x64) _mm512_aesenc_epi128 ((__m512i) a, (__m512i) k); +} + +static_always_inline u8x64 +aes_enc_last_round_x4 (u8x64 a, u8x64 k) +{ + return (u8x64) _mm512_aesenclast_epi128 ((__m512i) a, (__m512i) k); +} + +static_always_inline u8x64 +aes_dec_round_x4 (u8x64 a, u8x64 k) +{ + return (u8x64) _mm512_aesdec_epi128 ((__m512i) a, (__m512i) k); +} + +static_always_inline u8x64 +aes_dec_last_round_x4 (u8x64 a, u8x64 k) +{ + return (u8x64) _mm512_aesdeclast_epi128 ((__m512i) a, (__m512i) k); +} +#endif + static_always_inline u8x16 aes_enc_last_round (u8x16 a, u8x16 k) { -- cgit 1.2.3-korg