|
Botan 3.14.1
Crypto and TLS for C&
|
#include <simd_4x32.h>
Public Member Functions | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | andc (const SIMD_4x32 &other) const noexcept |
| BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32 | bswap () const noexcept |
| template<size_t W> | |
| uint32_t BOTAN_FN_ISA_SIMD_4X32 | extract_word () const noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator& (const SIMD_4x32 &other) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator&= (const SIMD_4x32 &other) noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator+ (const SIMD_4x32 &other) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator+= (const SIMD_4x32 &other) noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator- (const SIMD_4x32 &other) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator-= (const SIMD_4x32 &other) noexcept |
| SIMD_4x32 & | operator= (const SIMD_4x32 &other)=default |
| SIMD_4x32 & | operator= (SIMD_4x32 &&other)=default |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator^ (const SIMD_4x32 &other) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator^= (const SIMD_4x32 &other) noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator^= (uint32_t other) noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator| (const SIMD_4x32 &other) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | operator|= (const SIMD_4x32 &other) noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | operator~ () const noexcept |
| native_simd_type BOTAN_FN_ISA_SIMD_4X32 | raw () const noexcept |
| BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32 | reverse_all_bytes () const |
| template<size_t ROT> requires (ROT > 0 && ROT < 32) | |
| BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32 | rotl () const noexcept |
| template<size_t ROT> | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | rotr () const noexcept |
| template<size_t I> requires (I <= 3) | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | shift_elems_left () const noexcept |
| template<size_t I> requires (I <= 3) | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | shift_elems_right () const noexcept |
| template<int SHIFT> requires (SHIFT > 0 && SHIFT < 32) | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | shl () const noexcept |
| template<int SHIFT> | |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | shr () const noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | sigma0 () const noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | sigma1 () const noexcept |
| BOTAN_FN_ISA_SIMD_4X32 | SIMD_4x32 () noexcept |
| SIMD_4x32 (const SIMD_4x32 &other)=default | |
| BOTAN_FN_ISA_SIMD_4X32 | SIMD_4x32 (native_simd_type x) noexcept |
| SIMD_4x32 (SIMD_4x32 &&other)=default | |
| BOTAN_FN_ISA_SIMD_4X32 | SIMD_4x32 (uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_be (std::span< uint8_t, 16 > out) const |
| void BOTAN_FN_ISA_SIMD_4X32 | store_be (uint32_t out[4]) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_be (uint8_t out[]) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_le (std::span< uint8_t, 16 > out) const |
| void BOTAN_FN_ISA_SIMD_4X32 | store_le (uint32_t out[4]) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_le (uint64_t out[2]) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_le (uint8_t out[]) const noexcept |
| void BOTAN_FN_ISA_SIMD_4X32 | store_native (void *out) const noexcept |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | swap_halves () const |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | top_bit_mask () const |
| SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | unsigned_lt (const SIMD_4x32 &other) const noexcept |
| ~SIMD_4x32 ()=default | |
Static Public Member Functions | |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | alignr4 (const SIMD_4x32 &a, const SIMD_4x32 &b) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | alignr8 (const SIMD_4x32 &a, const SIMD_4x32 &b) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | byte_blend (const SIMD_4x32 &mask, const SIMD_4x32 &a, const SIMD_4x32 &b) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | byte_blend (uint32_t mask, const SIMD_4x32 &a, const SIMD_4x32 &b) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | byte_shuffle (const SIMD_4x32 &tbl, const SIMD_4x32 &idx) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | choose (const SIMD_4x32 &mask, const SIMD_4x32 &a, const SIMD_4x32 &b) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | load_be (const void *in) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | load_be (std::span< const uint8_t, 16 > in) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | load_le (const void *in) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | load_le (std::span< const uint8_t, 16 > in) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | load_native (const void *in) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | majority (const SIMD_4x32 &x, const SIMD_4x32 &y, const SIMD_4x32 &z) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | masked_byte_shuffle (const SIMD_4x32 &tbl, const SIMD_4x32 &idx) |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | splat (uint32_t B) noexcept |
| static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 | splat_u8 (uint8_t B) noexcept |
| static void BOTAN_FN_ISA_SIMD_4X32 | transpose (SIMD_4x32 &B0, SIMD_4x32 &B1, SIMD_4x32 &B2, SIMD_4x32 &B3) noexcept |
4x32 bit SIMD register
This class is not a general purpose SIMD type, and only offers instructions needed for evaluation of specific crypto primitives. For example it does not currently have equality operators of any kind.
Implemented for SSE2, POWER8 VSX, ARMv7/Aarch64 NEON, LoongArch LSX and Wasm SIMD128
Definition at line 57 of file simd_4x32.h.
|
default |
References SIMD_4x32().
Referenced by alignr4(), alignr8(), andc(), bswap(), byte_blend(), byte_blend(), byte_shuffle(), choose(), load_be(), load_be(), load_le(), load_le(), load_native(), majority(), masked_byte_shuffle(), operator&(), operator&=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator=(), operator^(), operator^=(), operator|(), operator|=(), operator~(), reverse_all_bytes(), rotl(), rotr(), shift_elems_left(), shift_elems_right(), shl(), shr(), sigma0(), sigma1(), SIMD_4x32(), SIMD_4x32(), splat(), splat_u8(), swap_halves(), top_bit_mask(), transpose(), and unsigned_lt().
|
default |
References SIMD_4x32().
|
default |
|
inlinenoexcept |
Zero initialize SIMD register with 4 32-bit elements
Definition at line 82 of file simd_4x32.h.
Referenced by alignr4(), alignr8(), andc(), bswap(), byte_shuffle(), choose(), load_native(), majority(), masked_byte_shuffle(), operator~(), reverse_all_bytes(), rotl(), shift_elems_left(), shift_elems_right(), shl(), shr(), sigma0(), sigma1(), splat(), splat_u8(), swap_halves(), top_bit_mask(), and unsigned_lt().
|
inlinenoexcept |
Load SIMD register with 4 32-bit elements
Definition at line 99 of file simd_4x32.h.
|
inlineexplicitnoexcept |
Definition at line 966 of file simd_4x32.h.
|
inlinestatic |
Definition at line 865 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
|
inlinestatic |
Definition at line 882 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by swap_halves().
|
inlinenoexcept |
Definition at line 515 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::clmul().
|
inlinenoexcept |
Return copy *this with each word byte swapped
Definition at line 544 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by byte_shuffle(), Botan::clmul(), load_be(), load_le(), masked_byte_shuffle(), store_be(), and store_le().
|
inlinestaticnoexcept |
Byte-granularity blend: for each byte position, select from a where the corresponding mask byte is 0xFF, or from b where it is 0x00.
Each byte of mask must be either 0x00 or 0xFF; other values produce undefined results.
Definition at line 753 of file simd_4x32.h.
References choose(), and SIMD_4x32().
Referenced by byte_blend().
|
inlinestaticnoexcept |
Byte-granularity blend: for each byte position, select from a where the corresponding mask byte is 0xFF, or from b where it is 0x00.
Each byte of mask must be either 0x00 or 0xFF; other values produce undefined results.
Definition at line 767 of file simd_4x32.h.
References byte_blend(), SIMD_4x32(), and splat().
|
inlinestatic |
Byte shuffle
Bytes are numbered in little-endian order (as written by store_le) regardless of the native endianness.
This function assumes that each byte of idx is <= 16; it may produce incorrect results if this does not hold.
Definition at line 796 of file simd_4x32.h.
References bswap(), raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::Gf2AffineTransformation::affine_transform(), Botan::hw_aes_inv_sbox(), Botan::hw_aes_sbox(), masked_byte_shuffle(), and reverse_all_bytes().
|
inlinestaticnoexcept |
Definition at line 730 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by byte_blend(), and majority().
|
inlinenoexcept |
Extract a single word from the register
Definition at line 942 of file simd_4x32.h.
References raw().
Referenced by Botan::SHA_1::sha1_compress_x86().
|
inlinestaticnoexcept |
Load a SIMD register with big-endian convention
Definition at line 194 of file simd_4x32.h.
References bswap(), load_native(), and SIMD_4x32().
Referenced by Botan::SHA_256::compress_digest_armv8(), Botan::SHA_256::compress_digest_x86(), load_be(), and Botan::SHA_1::sha1_compress_x86().
|
inlinestatic |
Definition at line 206 of file simd_4x32.h.
References load_be(), and SIMD_4x32().
|
inlinestaticnoexcept |
Load a SIMD register with little-endian convention
Definition at line 183 of file simd_4x32.h.
References bswap(), load_native(), and SIMD_4x32().
Referenced by Botan::SHA_256::compress_digest_armv8(), Botan::SHA_256::compress_digest_x86(), Botan::hw_aes_load_block(), Botan::load_block(), load_le(), and Botan::SHA_1::sha1_compress_x86().
|
inlinestatic |
Definition at line 202 of file simd_4x32.h.
References load_le(), and SIMD_4x32().
|
inlinestaticnoexcept |
Load a SIMD register from four 32-bit words stored in native byte order
Definition at line 166 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
|
inlinestaticnoexcept |
Definition at line 773 of file simd_4x32.h.
References choose(), SIMD_4x32(), and SIMD_4x32().
|
inlinestatic |
Byte shuffle with masking
Bytes are numbered as in byte_shuffle. If the index is >= 128 then the output byte is set to zero.
Warning: for indices between 16 and 128 this function may have different behaviors depending on the CPU; possibly the output is zero, tbl[idx % 16], or even undefined.
Definition at line 836 of file simd_4x32.h.
References bswap(), byte_shuffle(), raw(), SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Binary AND elements of a SIMD vector
Definition at line 388 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 452 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 394 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Subtract elements of a SIMD vector
Definition at line 361 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 408 of file simd_4x32.h.
References SIMD_4x32().
References SIMD_4x32().
References SIMD_4x32().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 422 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
|
inlinenoexcept |
Binary OR elements of a SIMD vector
Definition at line 379 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 438 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 500 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 964 of file simd_4x32.h.
Referenced by alignr4(), alignr8(), bswap(), byte_shuffle(), Botan::clmul(), extract_word(), Botan::hw_aes_dec_last_round(), Botan::hw_aes_dec_round(), Botan::hw_aes_dec_round_key(), Botan::hw_aes_enc_last_round(), Botan::hw_aes_enc_round(), Botan::hw_aes_inv_sbox(), Botan::hw_aes_sbox(), Botan::hw_aes_sbox_splat(), Botan::hw_aes_store_block(), masked_byte_shuffle(), rotl(), shift_elems_left(), shift_elems_right(), sigma0(), sigma1(), store_native(), swap_halves(), top_bit_mask(), and unsigned_lt().
|
inline |
Definition at line 536 of file simd_4x32.h.
References byte_shuffle(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::clmul(), Botan::load_block(), and Botan::store_block().
|
inlinenoexcept |
Left rotation by a compile time constant
Definition at line 297 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::rotl(), and rotr().
|
inlinenoexcept |
Right rotation by a compile time constant
Definition at line 345 of file simd_4x32.h.
References rotl(), and SIMD_4x32().
Referenced by Botan::rotr(), sigma0(), and sigma1().
|
inlinenoexcept |
Definition at line 562 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::clmul(), and Botan::polyval_multiply().
|
inlinenoexcept |
Definition at line 599 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::polyval_multiply().
|
inlinenoexcept |
Definition at line 467 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::mulx_polyval(), and Botan::shl().
|
inlinenoexcept |
Definition at line 485 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::Gf2AffineTransformation::affine_transform(), and Botan::mulx_polyval().
|
inlinenoexcept |
Definition at line 268 of file simd_4x32.h.
References raw(), rotr(), SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 282 of file simd_4x32.h.
References raw(), rotr(), SIMD_4x32(), and SIMD_4x32().
|
inlinestaticnoexcept |
Load SIMD register with one 32-bit element repeated
Definition at line 123 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by byte_blend(), and operator^=().
|
inlinestaticnoexcept |
Load SIMD register with one 8-bit element repeated
Definition at line 140 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::Gf2AffineTransformation::affine_transform().
|
inline |
Definition at line 261 of file simd_4x32.h.
References store_be().
Referenced by store_be().
|
inlinenoexcept |
|
inlinenoexcept |
Store a SIMD register with big-endian convention
Definition at line 253 of file simd_4x32.h.
References bswap(), and store_native().
|
inline |
Definition at line 263 of file simd_4x32.h.
References store_le().
Referenced by store_le().
|
inlinenoexcept |
Definition at line 210 of file simd_4x32.h.
References store_le().
Referenced by Botan::SHA_256::compress_digest_armv8(), Botan::SHA_256::compress_digest_x86(), Botan::hw_aes_store_block(), Botan::store_block(), store_le(), and store_le().
|
inlinenoexcept |
Definition at line 218 of file simd_4x32.h.
References store_le().
|
inlinenoexcept |
Store a SIMD register with little-endian convention
Definition at line 242 of file simd_4x32.h.
References bswap(), and store_native().
|
inlinenoexcept |
Store four 32-bit words in native byte order
Definition at line 225 of file simd_4x32.h.
References raw().
Referenced by store_be(), and store_le().
|
inline |
Swap the upper and lower 64-bit halves of the vector
Definition at line 930 of file simd_4x32.h.
References alignr8(), raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::polyval_reduce().
|
inline |
If the topmost bit of x is set, return a vector of all ones, otherwise a vector of all zeros ie: (v >> 127) ? splat(0xFFFFFFFF) : zero;
Most of the implementations work by doing an arithmetic shift of 31 to smear the top bits of each word, followed by a broadcast of the top word.
Definition at line 905 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::mulx_polyval().
|
inlinestaticnoexcept |
4x4 Transposition on SIMD registers
Definition at line 641 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Unsigned lane comparison; returns a mask with all bits set in each 32-bit lane that is (unsigned) less than the corresponding lane of other, and all bits cleared otherwise.
Definition at line 714 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().