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
60 changes: 32 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ lru = "0.18"
mockall = { version = "0.14" }
mockall_double = "0.3.1"
once_cell = "1.21.4"
openmls = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = [
openmls = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = [
"extensions-draft-08",
] }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83" }
openmls_libcrux_crypto = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", features = [
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3" }
openmls_libcrux_crypto = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", features = [
"extensions-draft-08",
] }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83" }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", features = [
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3" }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", features = [
"extensions-draft-08",
] }
owo-colors = { version = "4.1" }
Expand Down
24 changes: 12 additions & 12 deletions crates/xmtp-workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ hpke-rs = { git = "https://github.com/xmtp/hpke-rs", rev = "3425025bb43b68bdef28
hyper = { version = "1", features = ["http1", "http2", "server"] }
idna = { version = "1" }
indexmap = { version = "2", features = ["serde"] }
itertools = { version = "0.14" }
itertools = { version = "0.13" }
k256 = { version = "0.13", default-features = false, features = ["ecdh", "ecdsa", "std"] }
libcrux-ed25519 = { version = "0.0.7", default-features = false, features = ["rand"] }
log = { version = "0.4", default-features = false, features = ["std"] }
memchr = { version = "2" }
nu-ansi-term = { version = "0.50" }
num-traits = { version = "0.2", features = ["libm"] }
openmls = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["clonable", "test-utils"] }
openmls_memory_storage = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["test-utils"] }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", features = ["extensions-draft-08", "test-utils"] }
openmls = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["clonable", "test-utils"] }
openmls_memory_storage = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["test-utils"] }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", features = ["extensions-draft-08", "test-utils"] }
p256 = { version = "0.13", features = ["ecdh", "jwk"] }
percent-encoding = { version = "2" }
rand-274715c4dabd11b0 = { package = "rand", version = "0.9", features = ["serde"] }
Expand Down Expand Up @@ -147,18 +147,18 @@ hpke-rs = { git = "https://github.com/xmtp/hpke-rs", rev = "3425025bb43b68bdef28
hyper = { version = "1", features = ["http1", "http2", "server"] }
idna = { version = "1" }
indexmap = { version = "2", features = ["serde"] }
itertools = { version = "0.14" }
itertools = { version = "0.13" }
k256 = { version = "0.13", default-features = false, features = ["ecdh", "ecdsa", "std"] }
libcrux-ed25519 = { version = "0.0.7", default-features = false, features = ["rand"] }
log = { version = "0.4", default-features = false, features = ["std"] }
memchr = { version = "2" }
nu-ansi-term = { version = "0.50" }
num-traits = { version = "0.2", features = ["libm"] }
openmls = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["clonable", "test-utils"] }
openmls_memory_storage = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", default-features = false, features = ["test-utils"] }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "e125674303a715b00bf133ceba903862304eac83", features = ["extensions-draft-08", "test-utils"] }
openmls = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["clonable", "test-utils"] }
openmls_memory_storage = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["extensions-draft-08", "test-utils"] }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", default-features = false, features = ["test-utils"] }
openmls_traits = { git = "https://github.com/xmtp/openmls", rev = "9cdd5e798cb9217ef246964885e87d371ea553b3", features = ["extensions-draft-08", "test-utils"] }
p256 = { version = "0.13", features = ["ecdh", "jwk"] }
percent-encoding = { version = "2" }
proc-macro2 = { version = "1", features = ["span-locations"] }
Expand Down
12 changes: 12 additions & 0 deletions crates/xmtp_configuration/src/common/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ pub const MLS_PROTOCOL_VERSION: ProtocolVersion = ProtocolVersion::Mls10;

pub const WELCOME_HPKE_LABEL: &str = "MLS_WELCOME";

/// HPKE domain-separation label for external-invite GroupInfo payloads
/// wrapped via [`payload_encryption::wrap_payload_hpke`]. Distinct from
/// [`WELCOME_HPKE_LABEL`] to prevent cross-protocol oracle attacks.
///
/// The v1 external-invite flow uses symmetric AEAD encryption only (see
/// `xmtp_mls_common::invite::encrypted_group_info`), but the label is
/// reserved here so a future HPKE-based external-invite path can adopt it
/// without churning the public API.
///
/// [`payload_encryption::wrap_payload_hpke`]: https://docs.rs/xmtp_mls_common/latest/xmtp_mls_common/mls_ext/payload_encryption/fn.wrap_payload_hpke.html
pub const XMTP_EXTERNAL_INVITE_LABEL: &str = "XMTP_EXTERNAL_INVITE";

pub const MAX_GROUP_SYNC_RETRIES: usize = 3;

pub const MAX_INTENT_PUBLISH_ATTEMPTS: usize = 3;
Expand Down
20 changes: 17 additions & 3 deletions crates/xmtp_mls/benches/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use openmls_rust_crypto::RustCrypto;
use openmls_traits::{crypto::OpenMlsCrypto, random::OpenMlsRand};
use rand::{TryRng, rngs::SysRng};
use xmtp_configuration::{CIPHERSUITE, POST_QUANTUM_CIPHERSUITE};
use xmtp_mls::utils::bench::re_export::{WrapperAlgorithm, wrap_welcome};
use xmtp_mls::utils::bench::re_export::{WELCOME_HPKE_LABEL, WrapperAlgorithm, wrap_payload_hpke};

const BENCH_SIZES: [usize; 24] = [
16,
Expand Down Expand Up @@ -50,7 +50,15 @@ fn bench_encrypt_welcome_curve25519(c: &mut Criterion) {
SysRng.try_fill_bytes(payload.as_mut_slice()).unwrap();
(payload, keypair.public)
},
|(payload, key)| wrap_welcome(&payload, &[], &key, WrapperAlgorithm::Curve25519),
|(payload, key)| {
wrap_payload_hpke(
&payload,
&[],
&key,
WrapperAlgorithm::Curve25519,
WELCOME_HPKE_LABEL,
)
},
BatchSize::SmallInput,
)
});
Expand Down Expand Up @@ -80,7 +88,13 @@ fn bench_encrypt_welcome_post_quantum(c: &mut Criterion) {
(payload, keypair.public)
},
|(payload, key)| {
wrap_welcome(&payload, &[], &key, WrapperAlgorithm::XWingMLKEM768Draft6)
wrap_payload_hpke(
&payload,
&[],
&key,
WrapperAlgorithm::XWingMLKEM768Draft6,
WELCOME_HPKE_LABEL,
)
},
BatchSize::SmallInput,
)
Expand Down
2 changes: 2 additions & 0 deletions crates/xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub mod external_invite;

use crate::{
builder::DeviceSyncMode,
context::XmtpSharedContext,
Expand Down
Loading
Loading