diff options
author | Damjan Marion <dmarion@me.com> | 2020-02-12 18:25:39 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-02-12 19:10:55 +0000 |
commit | f0beeb0da03d584e60ecf7baf5f7ed552f7a082a (patch) | |
tree | fea23fb860144bc4a67de9fd33d01167b3462be5 /src/plugins | |
parent | 4fe44afb8d8ef2f50617c952945856a7808ae017 (diff) |
crypto-native: use and instead of blend
Faster and more portable...
Type: improvement
Change-Id: I915f8d3c45d1ba76ddfdbfac98482b04c98d148b
Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/crypto_native/aes.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/crypto_native/aes.h b/src/plugins/crypto_native/aes.h index 01298cd31d7..aacbf8ae34d 100644 --- a/src/plugins/crypto_native/aes.h +++ b/src/plugins/crypto_native/aes.h @@ -73,10 +73,7 @@ aes_block_store (u8 * p, u8x16 r) static_always_inline u8x16 aes_byte_mask (u8x16 x, u8 n_bytes) { - u8x16 mask = u8x16_is_greater (u8x16_splat (n_bytes), byte_mask_scale); - __m128i zero = { }; - - return (u8x16) _mm_blendv_epi8 (zero, (__m128i) x, (__m128i) mask); + return x & u8x16_is_greater (u8x16_splat (n_bytes), byte_mask_scale); } static_always_inline u8x16 |