Botan
3.9.0
Crypto and TLS for C&
src
lib
utils
cpuid
cpuid_ppc
cpuid_features.h
Go to the documentation of this file.
1
/**
2
* (C) 2025 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#ifndef BOTAN_CPUID_FEATURES_H_
8
#define BOTAN_CPUID_FEATURES_H_
9
10
#include <botan/api.h>
11
#include <cstdint>
12
#include <optional>
13
#include <string>
14
#include <string_view>
15
16
namespace
Botan
{
17
18
class
BOTAN_TEST_API
CPUFeature
{
19
public
:
20
enum
Bit
: uint32_t
/* NOLINT(performance-enum-size) */
{
21
ALTIVEC
= (1U << 0),
22
POWER_CRYPTO
= (1U << 1),
23
DARN
= (1U << 2),
24
25
SIMD_4X32
=
ALTIVEC
,
26
HW_AES
=
POWER_CRYPTO
,
27
HW_CLMUL
=
POWER_CRYPTO
,
28
};
29
30
CPUFeature
(
Bit
b) : m_bit(b) {}
// NOLINT(*-explicit-conversions)
31
32
uint32_t
as_u32
()
const
{
return
static_cast<
uint32_t
>
(m_bit); }
33
34
std::string
to_string
()
const
;
35
36
static
std::optional<CPUFeature>
from_string
(std::string_view s);
37
38
private
:
39
Bit
m_bit;
40
};
41
42
}
// namespace Botan
43
44
#endif
BOTAN_TEST_API
#define BOTAN_TEST_API
Definition
api.h:41
Botan::CPUFeature
Definition
cpuid.h:24
Botan::CPUFeature::as_u32
uint32_t as_u32() const
Definition
cpuid_features.h:32
Botan::CPUFeature::CPUFeature
CPUFeature(Bit b)
Definition
cpuid_features.h:30
Botan::CPUFeature::Bit
Bit
Definition
cpuid.h:26
Botan::CPUFeature::POWER_CRYPTO
@ POWER_CRYPTO
Definition
cpuid_features.h:22
Botan::CPUFeature::HW_CLMUL
@ HW_CLMUL
Definition
cpuid_features.h:34
Botan::CPUFeature::HW_AES
@ HW_AES
Definition
cpuid_features.h:33
Botan::CPUFeature::DARN
@ DARN
Definition
cpuid_features.h:23
Botan::CPUFeature::SIMD_4X32
@ SIMD_4X32
Definition
cpuid_features.h:32
Botan::CPUFeature::ALTIVEC
@ ALTIVEC
Definition
cpuid_features.h:21
Botan::CPUFeature::from_string
static std::optional< CPUFeature > from_string(std::string_view s)
Botan::CPUFeature::to_string
std::string to_string() const
Botan
Definition
alg_id.cpp:13
Generated by
1.14.0