7#ifndef BOTAN_TLS_ALGO_IDS_H_
8#define BOTAN_TLS_ALGO_IDS_H_
10#include <botan/asn1_obj.h>
11#include <botan/pk_keys.h>
12#include <botan/types.h>
79#define BOTAN_TLS_KYBER_R3_DEPRECATED \
81 "Kyber r3 TLS support will be removed completely in Botan 3.7.0 (early 2025) see https://github.com/randombit/botan/issues/4403")
172 static std::optional<Group_Params> from_string(std::string_view group_name);
182 constexpr uint16_t
wire_code()
const {
return static_cast<uint16_t
>(m_code); }
184 constexpr bool is_x25519()
const {
return m_code == Group_Params_Code::X25519; }
186 constexpr bool is_x448()
const {
return m_code == Group_Params_Code::X448; }
189 return m_code == Group_Params_Code::SECP256R1 || m_code == Group_Params_Code::SECP384R1 ||
190 m_code == Group_Params_Code::SECP521R1 || m_code == Group_Params_Code::BRAINPOOL256R1 ||
191 m_code == Group_Params_Code::BRAINPOOL384R1 || m_code == Group_Params_Code::BRAINPOOL512R1;
196 return wire_code() >= 256 && wire_code() < 512;
200 return m_code == Group_Params_Code::FFDHE_2048 || m_code == Group_Params_Code::FFDHE_3072 ||
201 m_code == Group_Params_Code::FFDHE_4096 || m_code == Group_Params_Code::FFDHE_6144 ||
202 m_code == Group_Params_Code::FFDHE_8192;
209 return m_code == Group_Params_Code::KYBER_512_R3_OQS || m_code == Group_Params_Code::KYBER_768_R3_OQS ||
210 m_code == Group_Params_Code::KYBER_1024_R3_OQS;
216 return m_code == Group_Params_Code::eFRODOKEM_640_SHAKE_OQS ||
217 m_code == Group_Params_Code::eFRODOKEM_976_SHAKE_OQS ||
218 m_code == Group_Params_Code::eFRODOKEM_1344_SHAKE_OQS ||
219 m_code == Group_Params_Code::eFRODOKEM_640_AES_OQS ||
220 m_code == Group_Params_Code::eFRODOKEM_976_AES_OQS ||
221 m_code == Group_Params_Code::eFRODOKEM_1344_AES_OQS;
224 constexpr bool is_pure_ecc_group()
const {
return is_x25519() || is_x448() || is_ecdh_named_curve(); }
230 return is_pure_kyber() || is_pure_frodokem() || is_pqc_hybrid();
239 return m_code == Group_Params_Code::HYBRID_SECP256R1_ML_KEM_768 ||
240 m_code == Group_Params_Code::HYBRID_X25519_ML_KEM_768 ||
241 m_code == Group_Params_Code::HYBRID_X25519_KYBER_512_R3_CLOUDFLARE ||
242 m_code == Group_Params_Code::HYBRID_X25519_KYBER_512_R3_OQS ||
243 m_code == Group_Params_Code::HYBRID_X25519_KYBER_768_R3_OQS ||
244 m_code == Group_Params_Code::HYBRID_X448_KYBER_768_R3_OQS ||
245 m_code == Group_Params_Code::HYBRID_X25519_eFRODOKEM_640_SHAKE_OQS ||
246 m_code == Group_Params_Code::HYBRID_X25519_eFRODOKEM_640_AES_OQS ||
247 m_code == Group_Params_Code::HYBRID_X448_eFRODOKEM_976_SHAKE_OQS ||
248 m_code == Group_Params_Code::HYBRID_X448_eFRODOKEM_976_AES_OQS ||
249 m_code == Group_Params_Code::HYBRID_SECP256R1_KYBER_512_R3_OQS ||
250 m_code == Group_Params_Code::HYBRID_SECP256R1_KYBER_768_R3_OQS ||
251 m_code == Group_Params_Code::HYBRID_SECP256R1_eFRODOKEM_640_SHAKE_OQS ||
252 m_code == Group_Params_Code::HYBRID_SECP256R1_eFRODOKEM_640_AES_OQS ||
253 m_code == Group_Params_Code::HYBRID_SECP384R1_KYBER_768_R3_OQS ||
254 m_code == Group_Params_Code::HYBRID_SECP384R1_eFRODOKEM_976_SHAKE_OQS ||
255 m_code == Group_Params_Code::HYBRID_SECP384R1_eFRODOKEM_976_AES_OQS ||
256 m_code == Group_Params_Code::HYBRID_SECP521R1_KYBER_1024_R3_OQS ||
257 m_code == Group_Params_Code::HYBRID_SECP521R1_eFRODOKEM_1344_SHAKE_OQS ||
258 m_code == Group_Params_Code::HYBRID_SECP521R1_eFRODOKEM_1344_AES_OQS;
267 return is_pure_kyber() || is_pure_frodokem() || is_pqc_hybrid();
273 std::optional<std::string> to_string()
const;
constexpr bool operator==(Group_Params other) const
constexpr bool is_dh_named_group() const
constexpr bool is_in_ffdhe_range() const
constexpr bool operator<(Group_Params other) const
constexpr bool is_pqc_hybrid() const
constexpr bool is_kem() const
constexpr bool is_post_quantum() const
constexpr bool operator==(Group_Params_Code code) const
constexpr bool is_ecdh_named_curve() const
constexpr uint16_t wire_code() const
constexpr bool is_pure_frodokem() const
constexpr bool is_pure_kyber() const
constexpr Group_Params_Code code() const
constexpr Group_Params(uint16_t code)
constexpr Group_Params(Group_Params_Code code)
constexpr bool is_x448() const
constexpr bool is_pure_ecc_group() const
constexpr bool is_x25519() const
int(* final)(unsigned char *, CTX *)
#define BOTAN_DIAGNOSTIC_POP
#define BOTAN_DIAGNOSTIC_PUSH
#define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
#define BOTAN_PUBLIC_API(maj, min)
Kex_Algo kex_method_from_string(std::string_view str)
Auth_Method auth_method_from_string(std::string_view str)
std::string kdf_algo_to_string(KDF_Algo algo)
@ AES_256_CBC_HMAC_SHA256
@ AES_256_CBC_HMAC_SHA384
@ AES_128_CBC_HMAC_SHA256
std::string kex_method_to_string(Kex_Algo method)
bool key_exchange_is_psk(Kex_Algo m)
std::string auth_method_to_string(Auth_Method method)
@ HYBRID_X448_eFRODOKEM_976_SHAKE_OQS
@ HYBRID_X25519_ML_KEM_768
@ HYBRID_X25519_eFRODOKEM_640_SHAKE_OQS
@ HYBRID_SECP521R1_KYBER_1024_R3_OQS
@ HYBRID_X25519_KYBER_768_R3_OQS
@ HYBRID_X448_eFRODOKEM_976_AES_OQS
@ eFRODOKEM_640_SHAKE_OQS
@ HYBRID_SECP256R1_ML_KEM_768
@ HYBRID_SECP256R1_eFRODOKEM_640_SHAKE_OQS
@ HYBRID_SECP521R1_eFRODOKEM_1344_SHAKE_OQS
@ HYBRID_X25519_KYBER_512_R3_CLOUDFLARE
@ HYBRID_SECP384R1_eFRODOKEM_976_AES_OQS
@ HYBRID_SECP256R1_eFRODOKEM_640_AES_OQS
@ HYBRID_X25519_eFRODOKEM_640_AES_OQS
@ HYBRID_X448_KYBER_768_R3_OQS
@ eFRODOKEM_1344_SHAKE_OQS
@ HYBRID_SECP256R1_KYBER_768_R3_OQS
@ HYBRID_SECP521R1_eFRODOKEM_1344_AES_OQS
@ eFRODOKEM_976_SHAKE_OQS
@ HYBRID_SECP256R1_KYBER_512_R3_OQS
@ HYBRID_SECP384R1_KYBER_768_R3_OQS
@ HYBRID_X25519_KYBER_512_R3_OQS
@ HYBRID_SECP384R1_eFRODOKEM_976_SHAKE_OQS
#define BOTAN_TLS_KYBER_R3_DEPRECATED