Botan 2.19.0
Crypto and TLS for C&
tls_algos.h
Go to the documentation of this file.
1/*
2* (C) 2017 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_TLS_ALGO_IDS_H_
8#define BOTAN_TLS_ALGO_IDS_H_
9
10#include <botan/types.h>
11#include <string>
12#include <vector>
13
14//BOTAN_FUTURE_INTERNAL_HEADER(tls_algos.h)
15
16namespace Botan {
17
18namespace TLS {
19
20enum class Cipher_Algo {
22
29
37
41
46
47 ARIA_128_GCM = 500,
49
52};
53
54enum class KDF_Algo {
55 SHA_1,
56 SHA_256,
57 SHA_384,
58};
59
60std::string BOTAN_DLL kdf_algo_to_string(KDF_Algo algo);
61
62enum class Nonce_Format {
66};
67
68// TODO encoding should match signature_algorithms extension
69// TODO this should include hash etc as in TLS v1.3
70enum class Auth_Method {
71 RSA,
72 DSA,
73 ECDSA,
74
75 // These are placed outside the encodable range
76 IMPLICIT = 0x10000,
78};
79
82
83/*
84* This matches the wire encoding
85*/
86enum class Signature_Scheme : uint16_t {
87 NONE = 0x0000,
88
89 RSA_PKCS1_SHA1 = 0x0201,
90 RSA_PKCS1_SHA256 = 0x0401,
91 RSA_PKCS1_SHA384 = 0x0501,
92 RSA_PKCS1_SHA512 = 0x0601,
93
94 DSA_SHA1 = 0x0202,
95 DSA_SHA256 = 0x0402,
96 DSA_SHA384 = 0x0502,
97 DSA_SHA512 = 0x0602,
98
99 ECDSA_SHA1 = 0x0203,
100 ECDSA_SHA256 = 0x0403,
101 ECDSA_SHA384 = 0x0503,
102 ECDSA_SHA512 = 0x0603,
103
104 RSA_PSS_SHA256 = 0x0804,
105 RSA_PSS_SHA384 = 0x0805,
106 RSA_PSS_SHA512 = 0x0806,
107
108 EDDSA_25519 = 0x0807,
109 EDDSA_448 = 0x0808,
110};
111
112BOTAN_UNSTABLE_API const std::vector<Signature_Scheme>& all_signature_schemes();
113
119
120/*
121* Matches with wire encoding
122*/
123enum class Group_Params : uint16_t {
124 NONE = 0,
125
126 SECP256R1 = 23,
127 SECP384R1 = 24,
128 SECP521R1 = 25,
129 BRAINPOOL256R1 = 26,
130 BRAINPOOL384R1 = 27,
131 BRAINPOOL512R1 = 28,
132
133 X25519 = 29,
134
135 FFDHE_2048 = 256,
136 FFDHE_3072 = 257,
137 FFDHE_4096 = 258,
138 FFDHE_6144 = 259,
139 FFDHE_8192 = 260,
140};
141
142std::string group_param_to_string(Group_Params group);
143Group_Params group_param_from_string(const std::string& group_name);
145
146enum class Kex_Algo {
148 DH,
149 ECDH,
150 CECPQ1,
151 SRP_SHA,
152 PSK,
153 DHE_PSK,
154 ECDHE_PSK,
155};
156
158Kex_Algo BOTAN_TEST_API kex_method_from_string(const std::string& str);
159
161 {
162 return (m == Kex_Algo::PSK ||
163 m == Kex_Algo::DHE_PSK ||
165 }
166
167}
168
169}
170
171#endif
#define BOTAN_UNSTABLE_API
Definition: compiler.h:44
#define BOTAN_TEST_API
Definition: compiler.h:51
const std::vector< Signature_Scheme > & all_signature_schemes()
Definition: tls_algos.cpp:229
Auth_Method auth_method_from_string(const std::string &str)
Definition: tls_algos.cpp:102
bool signature_scheme_is_known(Signature_Scheme scheme)
Definition: tls_algos.cpp:262
Group_Params group_param_from_string(const std::string &group_name)
Definition: tls_algos.cpp:124
std::string kdf_algo_to_string(KDF_Algo algo)
Definition: tls_algos.cpp:14
std::string kex_method_to_string(Kex_Algo method)
Definition: tls_algos.cpp:29
bool group_param_is_dh(Group_Params group)
Definition: tls_algos.cpp:118
Signature_Scheme
Definition: tls_algos.h:86
bool key_exchange_is_psk(Kex_Algo m)
Definition: tls_algos.h:160
std::string hash_function_of_scheme(Signature_Scheme scheme)
Definition: tls_algos.cpp:191
std::string group_param_to_string(Group_Params group)
Definition: tls_algos.cpp:155
std::string padding_string_for_scheme(Signature_Scheme scheme)
Definition: tls_algos.cpp:379
std::string auth_method_to_string(Auth_Method method)
Definition: tls_algos.cpp:83
Kex_Algo kex_method_from_string(const std::string &str)
Definition: tls_algos.cpp:54
std::string sig_scheme_to_string(Signature_Scheme scheme)
Definition: tls_algos.cpp:329
std::string signature_algorithm_of_scheme(Signature_Scheme scheme)
Definition: tls_algos.cpp:291
Definition: alg_id.cpp:13
@ NONE
Definition: filter.h:171