Botan 3.9.0
Crypto and TLS for C&
|
#include <cpuid.h>
Public Types | |
typedef CPUFeature | Feature |
Static Public Member Functions | |
static std::optional< CPUID::Feature > | bit_from_string (std::string_view tok) |
static std::optional< std::string > | check (CPUID::Feature feat) |
static std::optional< std::string > | check (CPUID::Feature feat1, CPUID::Feature feat2) |
static void | clear_cpuid_bit (CPUID::Feature bit) |
static bool | has (CPUID::Feature feat) |
static bool | has (CPUID::Feature feat1, CPUID::Feature feat2) |
template<typename T> | |
static uint32_t | if_set (uint64_t cpuid, T flag, CPUID::Feature bit, uint32_t allowed) |
static void | initialize () |
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.
typedef CPUFeature Botan::CPUID::Feature |
|
static |
Definition at line 90 of file cpuid.cpp.
References Botan::CPUFeature::from_string().
|
inlinestatic |
Check if a feature is supported returning the associated string if so
This is a helper function used to implement provider()
Definition at line 67 of file cpuid.h.
References Botan::CPUFeature::as_u32(), and Botan::CPUFeature::to_string().
Referenced by Botan::ChaCha::provider(), Botan::GHASH::provider(), Botan::IDEA::provider(), Botan::Keccak_Permutation::provider(), Botan::Noekeon::provider(), Botan::Serpent::provider(), Botan::SHA_1::provider(), Botan::SHACAL2::provider(), Botan::SM4::provider(), and Botan::ZFEC::provider().
|
inlinestatic |
Check if a feature is supported returning the associated string if so
This is a helper function used to implement provider()
Definition at line 80 of file cpuid.h.
References Botan::CPUFeature::as_u32(), and Botan::CPUFeature::to_string().
|
inlinestatic |
Definition at line 109 of file cpuid.h.
References Botan::CPUFeature::as_u32().
|
inlinestatic |
Check if a feature is supported
Definition at line 94 of file cpuid.h.
References Botan::CPUFeature::as_u32().
Referenced by Botan::Processor_RNG::available(), Botan::Argon2::blamka(), Botan::SHA_256::compress_digest(), Botan::SHA_512::compress_digest(), Botan::SHA_1::compress_n(), Botan::AES_128::decrypt_n(), Botan::AES_192::decrypt_n(), Botan::AES_256::decrypt_n(), Botan::Camellia_128::decrypt_n(), Botan::Camellia_192::decrypt_n(), Botan::Camellia_256::decrypt_n(), Botan::IDEA::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::AES_128::encrypt_n(), Botan::AES_192::encrypt_n(), Botan::AES_256::encrypt_n(), Botan::Camellia_128::encrypt_n(), Botan::Camellia_192::encrypt_n(), Botan::Camellia_256::encrypt_n(), Botan::IDEA::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::OS::get_cpu_cycle_counter(), Botan::IDEA::parallelism(), Botan::Noekeon::parallelism(), Botan::SHACAL2::parallelism(), Botan::SM4::parallelism(), and Botan::Intel_Rdseed::poll().
|
inlinestatic |
Check if two features are both supported
Definition at line 99 of file cpuid.h.
References Botan::CPUFeature::as_u32().
|
inlinestatic |
A common helper for the various CPUID implementations
Definition at line 117 of file cpuid.h.
References Botan::CPUFeature::as_u32().
|
static |
|
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 34 of file cpuid.cpp.
References Botan::string_join(), and to_string().
Referenced by to_string().