Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
7bf2317
)
crypto-native: avoid overflow load on data
03/35803/1
author
Damjan Marion
<damarion@cisco.com>
Mon, 28 Mar 2022 13:22:00 +0000
(15:22 +0200)
committer
Damjan Marion
<damarion@cisco.com>
Mon, 28 Mar 2022 13:22:06 +0000
(15:22 +0200)
Type: improvement
Change-Id: I5317afa02fa1525a7d8df595b56eb6546ccded57
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/crypto_native/aes.h
patch
|
blob
|
history
diff --git
a/src/plugins/crypto_native/aes.h
b/src/plugins/crypto_native/aes.h
index
e7f8409
..
e0d8322
100644
(file)
--- 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
}