30 static std::optional<Ciphersuite>
by_id(uint16_t suite);
37 static std::optional<Ciphersuite>
from_name(std::string_view name);
42 static bool is_scsv(uint16_t suite);
57 std::string
to_string()
const {
return (m_iana_id ==
nullptr) ?
"unknown cipher suite" : m_iana_id; }
67 bool psk_ciphersuite()
const;
72 bool ecc_ciphersuite()
const;
77 bool cbc_ciphersuite()
const;
82 bool null_ciphersuite()
const;
87 bool aead_ciphersuite()
const;
89 bool signature_used()
const;
113 std::string
mac_algo()
const {
return m_mac_algo; }
122 size_t nonce_bytes_from_handshake()
const;
133 bool valid()
const {
return m_usable; }
142 bool is_usable()
const;
148 const char* cipher_algo,
149 size_t cipher_keylen,
150 const char* mac_algo,
154 m_ciphersuite_code(ciphersuite_code),
156 m_auth_method(auth_method),
157 m_kex_algo(kex_algo),
158 m_prf_algo(prf_algo),
159 m_nonce_format(nonce_format),
160 m_cipher_algo(cipher_algo),
161 m_mac_algo(mac_algo),
162 m_cipher_keylen(cipher_keylen),
163 m_mac_keylen(mac_keylen),
164 m_usable(is_usable()) {}
166 uint16_t m_ciphersuite_code = 0;
172 const char* m_iana_id;
174 Auth_Method m_auth_method;
177 Nonce_Format m_nonce_format;
179 const char* m_cipher_algo;
180 const char* m_mac_algo;
182 size_t m_cipher_keylen;
185 bool m_usable =
false;