aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_native/aes.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-02-13 13:11:02 +0100
committerDamjan Marion <damarion@cisco.com>2020-02-14 10:55:54 +0100
commite84e9d708e0a7571bc24ae2f443462ed8cddbb84 (patch)
tree352791e595a79fc021bc8f5d70991b1303db17ba /src/plugins/crypto_native/aes.h
parent3be33f17ecd14a12738a44f9c0e09cb3778b1345 (diff)
crypto-native: refactor CBC code
Type: refactor Change-Id: I61e25942de318d03fb3d75689259709d687479bc Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/crypto_native/aes.h')
-rw-r--r--src/plugins/crypto_native/aes.h26
1 files changed, 26 insertions, 0 deletions
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)
{