diff options
author | Damjan Marion <damarion@cisco.com> | 2024-01-15 11:37:33 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2024-01-16 17:40:40 +0000 |
commit | 7e9513b8fcc838114ca58a093c751f3a50bafed6 (patch) | |
tree | 1ab9ff01cc06b1b28a56ec7704400c69af0f633f /src | |
parent | 4a515d35a8702fafb1119e3dc4f969160b0e4372 (diff) |
vppinfra: enable AES tests on ARM
Type: improvement
Change-Id: I30f3b2924ab219a8bace87f358b1b823e8bc83bb
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vppinfra/crypto/aes_cbc.h | 7 | ||||
-rw-r--r-- | src/vppinfra/test/aes_cbc.c | 2 | ||||
-rw-r--r-- | src/vppinfra/test/aes_ctr.c | 2 | ||||
-rw-r--r-- | src/vppinfra/test/aes_gcm.c | 2 |
4 files changed, 3 insertions, 10 deletions
diff --git a/src/vppinfra/crypto/aes_cbc.h b/src/vppinfra/crypto/aes_cbc.h index 64bc071e910..cb3d0784051 100644 --- a/src/vppinfra/crypto/aes_cbc.h +++ b/src/vppinfra/crypto/aes_cbc.h @@ -27,17 +27,10 @@ clib_aes_cbc_encrypt (const aes_cbc_key_data_t *kd, const u8 *src, uword len, for (int i = 0; i < len; i += 16) { int j; -#if __x86_64__ r = u8x16_xor3 (r, *(u8x16u *) (src + i), k[0]); for (j = 1; j < rounds; j++) r = aes_enc_round_x1 (r, k[j]); r = aes_enc_last_round_x1 (r, k[rounds]); -#else - r ^= *(u8x16u *) (src + i); - for (j = 1; j < rounds - 1; j++) - r = vaesmcq_u8 (vaeseq_u8 (r, k[j])); - r = vaeseq_u8 (r, k[j]) ^ k[rounds]; -#endif *(u8x16u *) (dst + i) = r; } } diff --git a/src/vppinfra/test/aes_cbc.c b/src/vppinfra/test/aes_cbc.c index bff439ab7b5..be5f8fb176a 100644 --- a/src/vppinfra/test/aes_cbc.c +++ b/src/vppinfra/test/aes_cbc.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Cisco Systems, Inc. */ -#ifdef __AES__ +#if defined(__AES__) || defined(__ARM_FEATURE_CRYPTO) #include <vppinfra/format.h> #include <vppinfra/test/test.h> #include <vppinfra/crypto/aes_cbc.h> diff --git a/src/vppinfra/test/aes_ctr.c b/src/vppinfra/test/aes_ctr.c index 1bf08b208d5..2892700fb27 100644 --- a/src/vppinfra/test/aes_ctr.c +++ b/src/vppinfra/test/aes_ctr.c @@ -2,7 +2,7 @@ * Copyright(c) 2024 Cisco Systems, Inc. */ -#if defined(__AES__) +#if defined(__AES__) || defined(__ARM_FEATURE_CRYPTO) #include <vppinfra/format.h> #include <vppinfra/test/test.h> #include <vppinfra/crypto/aes_ctr.h> diff --git a/src/vppinfra/test/aes_gcm.c b/src/vppinfra/test/aes_gcm.c index aeaf7cf8c15..caa36b0f710 100644 --- a/src/vppinfra/test/aes_gcm.c +++ b/src/vppinfra/test/aes_gcm.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Cisco Systems, Inc. */ -#if defined(__AES__) && defined(__PCLMUL__) +#if (defined(__AES__) && defined(__PCLMUL__)) || defined(__ARM_FEATURE_CRYPTO) #include <vppinfra/format.h> #include <vppinfra/test/test.h> #include <vppinfra/crypto/aes_gcm.h> |