Group configuration

Two very similar structs can help configure groups upon their creation: MlsGroupJoinConfig and MlsGroupCreateConfig.

MlsGroupJoinConfig contains the following runtime-relevant configuration options for an MlsGroup and can be set on a per-client basis when a group is joined.

NameTypeExplanation
wire_format_policyWireFormatPolicyDefines the wire format policy for outgoing and incoming handshake messages.
padding_sizeusizeSize of padding in bytes. The default is 0.
max_past_epochsusizeMaximum number of past epochs for which application messages can be decrypted. The default is 0.
number_of_resumption_psksusizeNumber of resumption psks to keep. The default is 0.
use_ratchet_tree_extensionboolFlag indicating the Ratchet Tree Extension should be used. The default is false.
sender_ratchet_configurationSenderRatchetConfigurationSender ratchet configuration.

MlsGroupCreateConfig contains an MlsGroupJoinConfig, as well as a few additional parameters that are part of the group state that is agreed-upon by all group members. It can be set at the time of a group's creation and contains the following additional configuration options.

NameTypeExplanation
required_capabilitiesRequiredCapabilitiesExtensionRequired capabilities (extensions and proposal types).
external_sendersExternalSendersExtensionsList credentials of non-group members that are allowed to send proposals to the group.

Both ways of group configurations can be specified by using the struct's builder pattern, or choosing their default values. The default value contains safe values for all parameters and is suitable for scenarios without particular requirements.

Example join configuration:

    let mls_group_config = MlsGroupJoinConfig::builder()
        .padding_size(100)
        .sender_ratchet_configuration(SenderRatchetConfiguration::new(
            10,   // out_of_order_tolerance
            2000, // maximum_forward_distance
        ))
        .use_ratchet_tree_extension(true)
        .build();

Example create configuration:

    let mls_group_create_config = MlsGroupCreateConfig::builder()
        .padding_size(100)
        .sender_ratchet_configuration(SenderRatchetConfiguration::new(
            10,   // out_of_order_tolerance
            2000, // maximum_forward_distance
        ))
        .external_senders(vec![ExternalSender::new(
            ds_credential_with_key.signature_key.clone(),
            ds_credential_with_key.credential.clone(),
        )])
        .crypto_config(CryptoConfig::with_default_version(ciphersuite))
        .use_ratchet_tree_extension(true)
        .build();