Botan 3.6.1
Crypto and TLS for C&
|
#include <cpuid.h>
Public Types | |
enum | CPUID_bits : uint32_t { CPUID_IS_BIG_ENDIAN_BIT = (1U << 30) , CPUID_INITIALIZED_BIT = (1U << 31) } |
Static Public Member Functions | |
static std::vector< CPUID::CPUID_bits > | bit_from_string (std::string_view tok) |
static void | clear_cpuid_bit (CPUID_bits bit) |
static bool | has_carryless_multiply () |
static bool | has_cpuid_bit (CPUID_bits elem) |
static bool | has_hw_aes () |
static bool | has_simd_32 () |
static bool | has_vperm () |
static void | initialize () |
static bool | is_big_endian () |
static bool | is_little_endian () |
static std::string | to_string () |
A class handling runtime CPU feature detection. It is limited to just the features necessary to implement CPU specific code in Botan, rather than being a general purpose utility.
This class supports:
enum Botan::CPUID::CPUID_bits : uint32_t |
Enumerator | |
---|---|
CPUID_IS_BIG_ENDIAN_BIT | |
CPUID_INITIALIZED_BIT |
Definition at line 96 of file cpuid.h.
|
static |
Definition at line 148 of file cpuid.cpp.
References BOTAN_UNUSED.
|
inlinestatic |
|
inlinestatic |
Check if the processor supports carryless multiply (CLMUL, PMULL)
Definition at line 366 of file cpuid.h.
Referenced by Botan::GHASH::provider().
|
inlinestatic |
|
inlinestatic |
Check if the processor supports hardware AES instructions
Definition at line 350 of file cpuid.h.
Referenced by Botan::AES_128::decrypt_n(), Botan::AES_192::decrypt_n(), Botan::AES_256::decrypt_n(), Botan::AES_128::encrypt_n(), Botan::AES_192::encrypt_n(), and Botan::AES_256::encrypt_n().
|
inlinestatic |
Return true if a 4x32 SIMD instruction set is available (SSE2, NEON, or Altivec/VMX)
Definition at line 84 of file cpuid.h.
Referenced by Botan::Noekeon::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::Noekeon::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::Noekeon::parallelism(), Botan::SHACAL2::parallelism(), Botan::ChaCha::provider(), Botan::Noekeon::provider(), Botan::Serpent::provider(), and Botan::SHACAL2::provider().
|
inlinestatic |
Check if the processor supports byte-level vector permutes (SSSE3, NEON, Altivec)
Definition at line 335 of file cpuid.h.
Referenced by Botan::AES_128::decrypt_n(), Botan::AES_192::decrypt_n(), Botan::AES_256::decrypt_n(), Botan::AES_128::encrypt_n(), Botan::AES_192::encrypt_n(), Botan::AES_256::encrypt_n(), Botan::GHASH::provider(), and Botan::ZFEC::provider().
|
static |
|
inlinestatic |
Definition at line 70 of file cpuid.h.
Referenced by Botan::SIMD_4x32::load_le().
|
inlinestatic |
Definition at line 60 of file cpuid.h.
Referenced by Botan::XMSS_Tools::concat(), Botan::XMSS_Tools::concat(), Botan::SIMD_4x32::load_be(), Botan::SIMD_4x32::store_be(), and Botan::SIMD_4x32::store_le().
|
static |
Return a possibly empty string containing list of known CPU extensions. Each name will be seperated by a space, and the ordering will be arbitrary. This list only contains values that are useful to Botan (for example FMA instructions are not checked).
Example outputs "sse2 ssse3 rdtsc", "neon arm_aes", "altivec"
Definition at line 19 of file cpuid.cpp.
References BOTAN_UNUSED, CPUID_PRINT, and Botan::string_join().