Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bindings/rust/standard/benchmarks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ pub enum KXGroup {
Secp256R1,
#[default]
X25519,
X25519MLKEM768,
}

impl Debug for KXGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Secp256R1 => write!(f, "secp256r1"),
Self::X25519 => write!(f, "x25519"),
Self::X25519MLKEM768 => write!(f, "X25519MLKEM768"),
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions bindings/rust/standard/benchmarks/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod openssl_bench_setup {
let ec_key = match crypto_config.kx_group {
KXGroup::Secp256R1 => "P-256",
KXGroup::X25519 => "X25519",
KXGroup::X25519MLKEM768 => "X25519MLKEM768",
};

let ssl_method = match mode {
Expand Down Expand Up @@ -143,6 +144,7 @@ mod rustls_bench_setup {
let kx_group = match crypto_config.kx_group {
KXGroup::Secp256R1 => &kx_group::SECP256R1,
KXGroup::X25519 => &kx_group::X25519,
KXGroup::X25519MLKEM768 => &kx_group::X25519MLKEM768,
};

let crypto_provider = Arc::new(CryptoProvider {
Expand Down Expand Up @@ -228,6 +230,8 @@ mod s2n_tls_bench_setup {
(CipherSuite::TLS_AES_256_GCM_SHA384, KXGroup::Secp256R1) => "20190802",
(CipherSuite::TLS_AES_128_GCM_SHA256, KXGroup::X25519) => "20240417",
(CipherSuite::TLS_AES_256_GCM_SHA384, KXGroup::X25519) => "20190801",
(CipherSuite::TLS_AES_128_GCM_SHA256, KXGroup::X25519MLKEM768) => "default_tls13",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We won't want to use named policies, as they can be updated in the future, so prefer a numbered policy for stability
  2. I don't think it's correct to have both of these mapping to the same policy. Generally the policy should have the mapped options as the highest preference. When an s2n-tls client is handshaking with an s2n-tls server, it can't negotiated both of these.

(CipherSuite::TLS_AES_256_GCM_SHA384, KXGroup::X25519MLKEM768) => "default_tls13",
};

let mut builder = s2n_tls::config::Builder::new();
Expand Down
Loading