summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-03-28 15:22:00 +0200
committerDamjan Marion <damarion@cisco.com>2022-03-28 15:22:06 +0200
commitd53e13de8e7304af34ecabc160c452d5fdb5916a (patch)
treef5d692ecf78e482a39c35832549af07b36f38a92 /src/plugins
parent7bf2317b45790d7b850c73f52abb87d76b443a10 (diff)
crypto-native: avoid overflow load on data
Type: improvement Change-Id: I5317afa02fa1525a7d8df595b56eb6546ccded57 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/crypto_native/aes.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/crypto_native/aes.h b/src/plugins/crypto_native/aes.h
index e7f840975d4..e0d832276e0 100644
--- a/src/plugins/crypto_native/aes.h
+++ b/src/plugins/crypto_native/aes.h
@@ -119,7 +119,10 @@ aes_load_partial (u8x16u * p, int n_bytes)
__m128i zero = { };
return (u8x16) _mm_mask_loadu_epi8 (zero, (1 << n_bytes) - 1, p);
#else
- return aes_byte_mask (CLIB_MEM_OVERFLOW_LOAD (p), n_bytes);
+ u8x16 v = {};
+ CLIB_ASSUME (n_bytes < 16);
+ clib_memcpy_fast (&v, p, n_bytes);
+ return v;
#endif
}