aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <dmarion@me.com>2020-02-12 10:59:14 +0100
committerNeale Ranns <nranns@cisco.com>2020-02-13 12:47:22 +0000
commit622b5ce61971066917cfba9ae795d9cb926f2700 (patch)
tree49ad66aaf27b10d17868bd45b0cc9fe1d4cbf98c /src/vppinfra
parent4e96ddaec8837b8c0bd27a75418e033da68e299b (diff)
crypto-native: add AArch64 AES-GCM native implementation
Type: feature Change-Id: I4f96b0af13b875d491704b010328a1814e1dbda1 Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/vector_neon.h9
-rw-r--r--src/vppinfra/vector_sse42.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/src/vppinfra/vector_neon.h b/src/vppinfra/vector_neon.h
index 307fbc541b2..81d99a64f05 100644
--- a/src/vppinfra/vector_neon.h
+++ b/src/vppinfra/vector_neon.h
@@ -194,6 +194,15 @@ u8x16_word_shift_right (u8x16 x, const int n)
return vextq_u8 (x, u8x16_splat (0), n);
}
+static_always_inline u8x16
+u8x16_reflect (u8x16 v)
+{
+ u8x16 mask = {
+ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+ };
+ return (u8x16) vqtbl1q_u8 (v, mask);
+}
+
#define CLIB_HAVE_VEC128_MSB_MASK
#define CLIB_HAVE_VEC128_UNALIGNED_LOAD_STORE
diff --git a/src/vppinfra/vector_sse42.h b/src/vppinfra/vector_sse42.h
index 0c1b2f0324f..c22e86e7437 100644
--- a/src/vppinfra/vector_sse42.h
+++ b/src/vppinfra/vector_sse42.h
@@ -635,6 +635,15 @@ u16x8_byte_swap (u16x8 v)
return (u16x8) _mm_shuffle_epi8 ((__m128i) v, (__m128i) swap);
}
+static_always_inline u8x16
+u8x16_reflect (u8x16 v)
+{
+ u8x16 mask = {
+ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
+ };
+ return (u8x16) _mm_shuffle_epi8 ((__m128i) v, (__m128i) mask);
+}
+
static_always_inline u32x4
u32x4_hadd (u32x4 v1, u32x4 v2)
{