Botan 3.8.1
Crypto and TLS for C&
|
#include <simd_4x32.h>
Public Member Functions | |
SIMD_4x32 | andc (const SIMD_4x32 &other) const noexcept |
BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32 | bswap () const noexcept |
SIMD_4x32 | operator& (const SIMD_4x32 &other) const noexcept |
void | operator&= (const SIMD_4x32 &other) noexcept |
SIMD_4x32 | operator+ (const SIMD_4x32 &other) const noexcept |
void | operator+= (const SIMD_4x32 &other) noexcept |
SIMD_4x32 | operator- (const SIMD_4x32 &other) const noexcept |
void | operator-= (const SIMD_4x32 &other) noexcept |
SIMD_4x32 & | operator= (const SIMD_4x32 &other)=default |
SIMD_4x32 & | operator= (SIMD_4x32 &&other)=default |
SIMD_4x32 | operator^ (const SIMD_4x32 &other) const noexcept |
void | operator^= (const SIMD_4x32 &other) noexcept |
void | operator^= (uint32_t other) noexcept |
SIMD_4x32 | operator| (const SIMD_4x32 &other) const noexcept |
void | operator|= (const SIMD_4x32 &other) noexcept |
SIMD_4x32 | operator~ () const noexcept |
native_simd_type | raw () const noexcept |
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 | rotr () const noexcept |
template<size_t I> requires (I <= 3) | |
SIMD_4x32 | shift_elems_left () const noexcept |
template<size_t I> requires (I <= 3) | |
SIMD_4x32 | shift_elems_right () const noexcept |
template<int SHIFT> requires (SHIFT > 0 && SHIFT < 32) | |
SIMD_4x32 | shl () const noexcept |
template<int SHIFT> | |
SIMD_4x32 | shr () const noexcept |
SIMD_4x32 | sigma0 () const noexcept |
SIMD_4x32 | sigma1 () const noexcept |
SIMD_4x32 () noexcept | |
SIMD_4x32 (const SIMD_4x32 &other)=default | |
SIMD_4x32 (native_simd_type x) noexcept | |
SIMD_4x32 (SIMD_4x32 &&other)=default | |
SIMD_4x32 (uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept | |
void | store_be (std::span< uint8_t, 16 > out) const |
void | store_be (uint32_t out[4]) const noexcept |
BOTAN_FN_ISA_SIMD_4X32 void | store_be (uint8_t out[]) const noexcept |
void | store_le (std::span< uint8_t, 16 > out) const |
void | store_le (uint32_t out[4]) const noexcept |
void | store_le (uint64_t out[2]) const noexcept |
void | store_le (uint8_t out[]) 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_shuffle (const SIMD_4x32 &tbl, const SIMD_4x32 &idx) |
static 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 | load_be (std::span< const uint8_t, 16 > in) |
static SIMD_4x32 | load_le (const void *in) noexcept |
static SIMD_4x32 | load_le (std::span< const uint8_t, 16 > in) |
static 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 | splat (uint32_t B) noexcept |
static SIMD_4x32 | splat_u8 (uint8_t B) noexcept |
static void | 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, VMX (Altivec), ARMv7/Aarch64 NEON, and LoongArch LSX
Definition at line 64 of file simd_4x32.h.
|
default |
References SIMD_4x32().
Referenced by alignr4(), alignr8(), andc(), bswap(), byte_shuffle(), choose(), load_be(), load_be(), load_le(), load_le(), majority(), masked_byte_shuffle(), operator&(), operator&=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator=(), operator^(), operator^=(), operator|(), operator|=(), operator~(), rotl(), rotr(), shift_elems_left(), shift_elems_right(), shl(), shr(), sigma0(), sigma1(), SIMD_4x32(), SIMD_4x32(), splat(), splat_u8(), and transpose().
|
default |
References SIMD_4x32().
|
default |
|
inlinenoexcept |
Zero initialize SIMD register with 4 32-bit elements
Definition at line 77 of file simd_4x32.h.
Referenced by alignr4(), alignr8(), andc(), bswap(), byte_shuffle(), choose(), load_be(), load_le(), masked_byte_shuffle(), operator~(), rotl(), shift_elems_left(), shift_elems_right(), shl(), shr(), sigma0(), sigma1(), splat(), and splat_u8().
|
inlinenoexcept |
Load SIMD register with 4 32-bit elements
Definition at line 92 of file simd_4x32.h.
|
inlineexplicitnoexcept |
Definition at line 756 of file simd_4x32.h.
|
inlinestatic |
Definition at line 727 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
|
inlinestatic |
Definition at line 741 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Definition at line 493 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Return copy *this with each word byte swapped
Definition at line 514 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by load_be(), load_le(), store_be(), and store_le().
|
inlinestatic |
Byte shuffle
This function assumes that each byte of idx is <= 16; it may produce incorrect results if this does not hold.
Definition at line 663 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
Referenced by masked_byte_shuffle().
|
inlinestaticnoexcept |
Definition at line 641 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by majority().
|
inlinestaticnoexcept |
Load a SIMD register with big-endian convention
Definition at line 166 of file simd_4x32.h.
References bswap(), Botan::load_be(), load_le(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::SHA_256::compress_digest_x86(), load_be(), and Botan::SHA_1::sha1_compress_x86().
|
inlinestatic |
Definition at line 188 of file simd_4x32.h.
References load_be(), and SIMD_4x32().
|
inlinestaticnoexcept |
Load a SIMD register with little-endian convention
Definition at line 143 of file simd_4x32.h.
References bswap(), Botan::load_le(), SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::SHA_256::compress_digest_x86(), load_be(), load_le(), and Botan::SHA_1::sha1_compress_x86().
|
inlinestatic |
|
inlinestaticnoexcept |
Definition at line 653 of file simd_4x32.h.
References choose(), and SIMD_4x32().
|
inlinestatic |
Byte shuffle with masking
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 698 of file simd_4x32.h.
References byte_shuffle(), raw(), SIMD_4x32(), and SIMD_4x32().
Binary AND elements of a SIMD vector
Definition at line 378 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 434 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 384 of file simd_4x32.h.
References SIMD_4x32().
Subtract elements of a SIMD vector
Definition at line 351 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 396 of file simd_4x32.h.
References SIMD_4x32().
References SIMD_4x32().
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 408 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Binary OR elements of a SIMD vector
Definition at line 369 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 422 of file simd_4x32.h.
References SIMD_4x32().
|
inlinenoexcept |
Definition at line 480 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 754 of file simd_4x32.h.
Referenced by alignr4(), alignr8(), bswap(), byte_shuffle(), masked_byte_shuffle(), rotl(), Botan::SHA_1::sha1_compress_x86(), shift_elems_left(), shift_elems_right(), sigma0(), sigma1(), and store_le().
|
inlinenoexcept |
Left rotation by a compile time constant
Definition at line 288 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 335 of file simd_4x32.h.
References rotl(), and SIMD_4x32().
Referenced by Botan::rotr(), sigma0(), and sigma1().
|
inlinenoexcept |
Definition at line 538 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 561 of file simd_4x32.h.
References raw(), SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 447 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by Botan::shl().
|
inlinenoexcept |
Definition at line 465 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 259 of file simd_4x32.h.
References raw(), rotr(), SIMD_4x32(), and SIMD_4x32().
|
inlinenoexcept |
Definition at line 273 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 112 of file simd_4x32.h.
References SIMD_4x32(), and SIMD_4x32().
Referenced by operator^=().
|
inlinestaticnoexcept |
Load SIMD register with one 8-bit element repeated
Definition at line 127 of file simd_4x32.h.
References Botan::make_uint32(), SIMD_4x32(), and SIMD_4x32().
|
inline |
Definition at line 252 of file simd_4x32.h.
References store_be().
Referenced by store_be().
|
inlinenoexcept |
|
inlinenoexcept |
Load a SIMD register with big-endian convention
Definition at line 228 of file simd_4x32.h.
References bswap(), Botan::store_be(), and store_le().
|
inline |
Definition at line 254 of file simd_4x32.h.
References store_le().
Referenced by store_le().
|
inlinenoexcept |
Definition at line 190 of file simd_4x32.h.
References store_le().
Referenced by Botan::SHA_256::compress_digest_x86(), store_be(), and store_le().
|
inlinenoexcept |
|
inlinenoexcept |
Load a SIMD register with little-endian convention
Definition at line 199 of file simd_4x32.h.
References bswap(), raw(), and Botan::store_le().
|
inlinestaticnoexcept |
4x4 Transposition on SIMD registers
Definition at line 586 of file simd_4x32.h.
References SIMD_4x32().