@@ -130,7 +130,32 @@ CipherSuite::get() const
130130 Digest::get<Digest::ID::SHA512>(),
131131 Signature::get<Signature::ID::Ed448>(),
132132 };
133- #endif
133+ #endif // !defined(WITH_BORINGSSL)
134+
135+ #if defined(WITH_PQ)
136+ static const auto ciphers_MLKEM768X25519_AES256GCM_SHA384_Ed25519 =
137+ CipherSuite::Ciphers{
138+ HPKE (
139+ KEM::ID::MLKEM768_X25519, KDF::ID::HKDF_SHA384, AEAD::ID::AES_256_GCM),
140+ Digest::get<Digest::ID::SHA384>(),
141+ Signature::get<Signature::ID::Ed25519>(),
142+ };
143+
144+ static const auto ciphers_MLKEM768P256_AES256GCM_SHA384_P256 =
145+ CipherSuite::Ciphers{
146+ HPKE (KEM::ID::MLKEM768_P256, KDF::ID::HKDF_SHA384, AEAD::ID::AES_256_GCM),
147+ Digest::get<Digest::ID::SHA384>(),
148+ Signature::get<Signature::ID::P256_SHA256>(),
149+ };
150+
151+ static const auto ciphers_MLKEM1024P384_AES256GCM_SHA384_P384 =
152+ CipherSuite::Ciphers{
153+ HPKE (
154+ KEM::ID::MLKEM1024_P384, KDF::ID::HKDF_SHA384, AEAD::ID::AES_256_GCM),
155+ Digest::get<Digest::ID::SHA384>(),
156+ Signature::get<Signature::ID::P384_SHA384>(),
157+ };
158+ #endif // defined(WITH_PQ)
134159
135160 switch (id) {
136161 case ID::unknown:
@@ -159,6 +184,17 @@ CipherSuite::get() const
159184 return ciphers_X448_CHACHA20POLY1305_SHA512_Ed448;
160185#endif
161186
187+ #if !defined(P256_SHA256)
188+ case ID::MLKEM768X25519_AES256GCM_SHA384_Ed25519:
189+ return ciphers_MLKEM768X25519_AES256GCM_SHA384_Ed25519;
190+
191+ case ID::MLKEM768P256_AES256GCM_SHA384_P256:
192+ return ciphers_MLKEM768P256_AES256GCM_SHA384_P256;
193+
194+ case ID::MLKEM1024P384_AES256GCM_SHA384_P384:
195+ return ciphers_MLKEM1024P384_AES256GCM_SHA384_P384;
196+ #endif
197+
162198 default :
163199 throw InvalidParameterError (" Unsupported ciphersuite" );
164200 }
@@ -200,25 +236,23 @@ CipherSuite::derive_tree_secret(const bytes& secret,
200236 return expand_with_label (secret, label, tls::marshal (generation), length);
201237}
202238
203- #if WITH_BORINGSSL
204- const std::array<CipherSuite::ID, 5 > all_supported_suites = {
205- CipherSuite::ID::X25519_AES128GCM_SHA256_Ed25519,
206- CipherSuite::ID::P256_AES128GCM_SHA256_P256,
207- CipherSuite::ID::X25519_CHACHA20POLY1305_SHA256_Ed25519,
208- CipherSuite::ID::P521_AES256GCM_SHA512_P521,
209- CipherSuite::ID::P384_AES256GCM_SHA384_P384,
210- };
211- #else
212- const std::array<CipherSuite::ID, 7 > all_supported_suites = {
213- CipherSuite::ID::X25519_AES128GCM_SHA256_Ed25519,
214- CipherSuite::ID::P256_AES128GCM_SHA256_P256,
215- CipherSuite::ID::X25519_CHACHA20POLY1305_SHA256_Ed25519,
216- CipherSuite::ID::P521_AES256GCM_SHA512_P521,
217- CipherSuite::ID::P384_AES256GCM_SHA384_P384,
218- CipherSuite::ID::X448_CHACHA20POLY1305_SHA512_Ed448,
219- CipherSuite::ID::X448_AES256GCM_SHA512_Ed448,
220- };
239+ const std::array<CipherSuite::ID, n_supported_suites>
240+ all_supported_cipher_suites = {
241+ CipherSuite::ID::X25519_AES128GCM_SHA256_Ed25519,
242+ CipherSuite::ID::P256_AES128GCM_SHA256_P256,
243+ CipherSuite::ID::X25519_CHACHA20POLY1305_SHA256_Ed25519,
244+ CipherSuite::ID::P521_AES256GCM_SHA512_P521,
245+ CipherSuite::ID::P384_AES256GCM_SHA384_P384,
246+ #if !defined(WITH_BORINGSSL)
247+ CipherSuite::ID::X448_CHACHA20POLY1305_SHA512_Ed448,
248+ CipherSuite::ID::X448_AES256GCM_SHA512_Ed448,
221249#endif
250+ #if defined(WITH_PQ)
251+ CipherSuite::ID::MLKEM768X25519_AES256GCM_SHA384_Ed25519,
252+ CipherSuite::ID::MLKEM768P256_AES256GCM_SHA384_P256,
253+ CipherSuite::ID::MLKEM1024P384_AES256GCM_SHA384_P384,
254+ #endif
255+ };
222256
223257// MakeKeyPackageRef(value) = KDF.expand(
224258// KDF.extract("", value), "MLS 1.0 KeyPackage Reference", 16)
0 commit comments