<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.8 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-mcmillion-mls-subgroups-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.20.1 -->
  <front>
    <title>MLS Subgroups</title>
    <seriesInfo name="Internet-Draft" value="draft-mcmillion-mls-subgroups-00"/>
    <author fullname="Brendan McMillion">
      <organization/>
      <address>
        <email>brendanmcmillion@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="March" day="20"/>
    <area>Security</area>
    <workgroup>Messaging Layer Security</workgroup>
    <abstract>
      <?line 37?>

<t>This document describes how the user of an MLS-based messaging service can
synchronize the operation of its devices, such that they behave as a single
virtual MLS client. This prevents other users of the messaging service from
being able to tell when a user changes its set of authorized devices, or which
device the user sent a message from.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://Bren2010.github.io/draft-subgroups/draft-mcmillion-mls-subgroups.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-mcmillion-mls-subgroups/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Messaging Layer Security Working Group mailing list (<eref target="mailto:mls@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/mls/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/mls/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/Bren2010/draft-subgroups"/>.</t>
    </note>
  </front>
  <middle>
    <?line 45?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>MLS allows users to communicate in an end-to-end encrypted fashion but doesn't
describe how to synchronize the operation of a user's devices. Instead,
applications are generally expected to create distinct MLS clients for each
device that a user has, and to ensure that all of the user's devices are added or
removed from a group atomically. This creates some technical difficulties, as it
can be hard for other members to ensure that the group truly stays in-sync with
each user's set of authorized devices. It also creates a privacy issue because
the members of a group can see which device a user sent a given message from, or
when any user changes its set of authorized devices.</t>
      <t>This document describes how to use an MLS group between all of a user's
authorized devices to synchronize behavior, such that other users of the
messaging service only see the user as a single MLS client. It does this in a
way that preserves the Forward Secrecy and Post-Compromise Security guarantees
of the groups that the user participates in, without requiring changes to the
wire format of MLS.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

<dl>
        <dt>Device:</dt>
        <dd>
          <t>A user interface for messaging, performing encryption as needed.</t>
        </dd>
        <dt>User:</dt>
        <dd>
          <t>A (normally) human operator of a device. Users may have many devices, but a
device only belongs to one user.</t>
        </dd>
        <dt>Subgroup:</dt>
        <dd>
          <t>An MLS group whose membership is exactly the set of authorized devices of a single user.</t>
        </dd>
        <dt>Virtual Client:</dt>
        <dd>
          <t>An MLS client that is controlled by one of many devices and synchronized by a subgroup.</t>
        </dd>
        <dt>Supergroup:</dt>
        <dd>
          <t>Refers to any MLS group which is not a subgroup.</t>
        </dd>
      </dl>
    </section>
    <section anchor="generation-of-private-keys">
      <name>Generation of Private Keys</name>
      <t>When devices generate new asymmetric keypairs for a virtual client (such as a
KeyPackage <tt>init_key</tt> or LeafNode <tt>encryption_key</tt>), they must do so in a way
that the other devices participating in the subgroup can compute the private key
as well. In the Subgroups protocol, a virtual client's private keys are derived
deterministically from a secret exported from the most recent epoch in a
subgroup. An extension is added to KeyPackages and LeafNodes generated this way
to communicate to the other devices, which may not become aware of the keypair
for several epochs, the epoch the private key was generated from.</t>
      <t>Note that signature private keys are not generated this way. A virtual client's
signature private key is generated once and shared directly with new devices.</t>
      <section anchor="secret-tree">
        <name>Secret Tree</name>
        <t>The Subgroups protocol uses a Secret Tree similar to <xref target="RFC9420"/>. The root of
the Secret Tree is an exported secret from a given epoch of a subgroup:</t>
        <artwork><![CDATA[
subgroup_secret_tree_root
    = MLS-Exporter("Subgroup Secret Tree", "", KDF.Nh)
]]></artwork>
        <t>The left and right child of a node in the Secret Tree are computed as follows:</t>
        <artset>
          <artwork type="svg"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="160" width="456" viewBox="0 0 456 160" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
              <path d="M 72,40 L 72,128" fill="none" stroke="black"/>
              <path d="M 248,80 L 248,88" fill="none" stroke="black"/>
              <path d="M 72,80 L 96,80" fill="none" stroke="black"/>
              <path d="M 72,128 L 96,128" fill="none" stroke="black"/>
              <polygon class="arrowhead" points="104,128 92,122.4 92,133.6" fill="black" transform="rotate(0,96,128)"/>
              <polygon class="arrowhead" points="104,80 92,74.4 92,85.6" fill="black" transform="rotate(0,96,80)"/>
              <g class="text">
                <text x="84" y="36">tree_node_[N]_secret</text>
                <text x="176" y="84">ExpandWithLabel(.</text>
                <text x="288" y="84">"tree",</text>
                <text x="352" y="84">"left",</text>
                <text x="416" y="84">KDF.Nh)</text>
                <text x="112" y="100">=</text>
                <text x="228" y="100">tree_node_[left(N)]_secret</text>
                <text x="180" y="132">ExpandWithLabel(.,</text>
                <text x="288" y="132">"tree",</text>
                <text x="356" y="132">"right",</text>
                <text x="424" y="132">KDF.Nh)</text>
                <text x="112" y="148">=</text>
                <text x="232" y="148">tree_node_[right(N)]_secret</text>
              </g>
            </svg>
          </artwork>
          <artwork type="ascii-art"><![CDATA[
tree_node_[N]_secret
        |
        |
        +--> ExpandWithLabel(., "tree", "left", KDF.Nh)
        |    = tree_node_[left(N)]_secret
        |
        +--> ExpandWithLabel(., "tree", "right", KDF.Nh)
             = tree_node_[right(N)]_secret
]]></artwork>
        </artset>
        <t>The Secret Tree maps bit strings to a value of size <tt>KDF.Nh</tt>. The root,
<tt>subgroup_secret_tree_root</tt>, is the value associated with the empty bit string.
Its left child is the value associated with the bit string "0", while its right
child is the value associated with the bit string "1", and so on recursively.</t>
        <t>Devices follow a strict deletion schedule, and delete any node as soon as:</t>
        <ul spacing="normal">
          <li>
            <t>its left and right children have been computed, or</t>
          </li>
          <li>
            <t>a private key has been derived from the node.</t>
          </li>
        </ul>
        <t>This ensures that any private keys that are derived from the Secret Tree can be
deleted and won't be able to be re-derived, providing Forward Secrecy.</t>
      </section>
      <section anchor="private-keys">
        <name>Private Keys</name>
        <t>Devices will need to generate either an <tt>init_key</tt> for a KeyPackage, or an
<tt>encryption_key</tt> for a LeafNode. To do this, the device finds its leaf index in
the subgroup <tt>leaf_index</tt>, chooses a 32-bit number <tt>random</tt>, converts both to a
series of bits, and concatenates them to get a series of 64 bits: <tt>leaf_index ||
random</tt>. This series of bits is used to lookup a node in the Secret Tree,
<tt>tree_node_secret</tt>.</t>
        <t>For a KeyPackage <tt>init_key</tt>, the device computes:</t>
        <artwork><![CDATA[
init_secret = DeriveSecret(tree_node_secret, "Subgroup KeyPackage")
init_priv, init_pub = KEM.DeriveKeyPair(init_secret)
]]></artwork>
        <t>For a LeafNode <tt>encryption_key</tt>, the device computes:</t>
        <artwork><![CDATA[
leaf_secret = DeriveSecret(tree_node_secret, "Subgroup LeafNode")

leaf_node_secret = DeriveSecret(leaf_secret, "node")
leaf_priv, leaf_pub = KEM.DeriveKeyPair(leaf_node_secret)
]]></artwork>
        <t>If the LeafNode is part of a Commit message, the device also computes
<tt>path_secret[0]</tt> from <tt>leaf_secret</tt>:</t>
        <artwork><![CDATA[
path_secret[0] = DeriveSecret(leaf_secret, "path")
]]></artwork>
        <t>Individual devices <bcp14>MUST</bcp14> take care to avoid reusing <tt>random</tt> values. Note that
the Secret Tree nodes are computed with the subgroup ciphersuite's algorithms,
but <tt>init_secret</tt> and <tt>leaf_secret</tt> are computed with the supergroup
ciphersuite's algorithms.</t>
      </section>
      <section anchor="subgroup-extension">
        <name>Subgroup Extension</name>
        <t>As mentioned, devices may not always be immediately aware of when another device
has generated a private key. This means that devices need a way to communicate
to each other the information they used to derive a private key. The <tt>subgroup</tt>
extension in a KeyPackage or LeafNode provides this information:</t>
        <artwork><![CDATA[
struct {
  uint64 epoch;
  uint32 leaf_index;
  uint32 random;
} PrivateKeyInfo;

opaque subgroup<V>;
]]></artwork>
        <t>The extension is a byte string containing a <tt>PrivateKeyInfo</tt> struct, which has
been encrypted with the AEAD from the subgroup's ciphersuite:</t>
        <artwork><![CDATA[
nonce is sampled at random
subgroup = nonce || AEAD.Seal(key, nonce, "", PrivateKeyInfo)
]]></artwork>
        <t>The <tt>epoch</tt> field is the epoch of the subgroup that was used, <tt>leaf_index</tt> is
the index of the device's leaf in the subgroup, and <tt>random</tt> is the random value
chosen by the device during generation.</t>
        <t>The <tt>key</tt> used for encryption is fixed long-term and shared among the devices in
a subgroup.</t>
      </section>
    </section>
    <section anchor="application-messages">
      <name>Application Messages</name>
      <t>Given that MLS generates the encryption keys and nonces for application and
handshake messages sequentially, but a virtual client may send messages from
several devices simultaneously, devices must take care to avoid reusing
encryption keys and nonces.</t>
      <t>If two devices encrypt a message with the same key simultaneously, they may
have already deleted the relevant encryption key by the time they receive the
other device's message, which will cause a decryption failure. This is a
functional issue, and the best solution depends on whether the Delivery Service
is strongly or eventually consistent <xref target="I-D.ietf-mls-architecture"/>. Devices
communicating with a strongly consistent DS can prevent this issue by checking
that they have processed all the messages sent to a group before sending their
own message. Alternatively, devices communicating with an eventually consistent
DS may simply need to retain encryption keys for a short period of time after
use in case they are still necessary.</t>
      <t>However, if two devices encrypt a message with both the same key and nonce
simultaneously, this could compromise the message's confidentiality and
integrity. Devices prevent this by ensuring two devices in a subgroup never
choose the same <tt>reuse_guard</tt>.</t>
      <section anchor="small-space-prp">
        <name>Small-Space PRP</name>
        <t>A small-space pseudorandom permutation (PRP) is a cryptographic algorithm that
works similar to a block cipher, while also being able to adhere to format
constraints. In particular, it is able to perform a psuedorandom permutation
over an arbitrary input and output space.</t>
        <t>This document uses the FF1 mode from <xref target="NIST"/> with the input-output space of
32-bit integers, instantiated with AES-128.</t>
        <artwork><![CDATA[
output = SmallSpacePRP.Encrypt(key, input)
input = SmallSpacePRP.Decrypt(key, output)
]]></artwork>
      </section>
      <section anchor="reuse-guard">
        <name>Reuse Guard</name>
        <t>In the unmodified MLS protocol, the <tt>reuse_guard</tt> is chosen randomly. In the
Subgroups protocol, devices choose a random value <tt>x</tt> such that <tt>x</tt> modulo the
number of leaves in the subgroup is equal to its <tt>leaf_index</tt>. They then
calculate:</t>
        <artwork><![CDATA[
prp_key = ExpandWithLabel(key_schedule_nonce, "reuse guard", leaf_secret, 16)
reuse_guard = SmallSpacePRP.Encrypt(prp_key, x)
]]></artwork>
        <t>ExpandWithLabel is computed with the subgroup ciphersuite's algorithms.
<tt>key_schedule_nonce</tt> is the nonce provided by the key schedule for encrypting
this message, and <tt>leaf_secret</tt> is the secret corresponding to the virtual
client's LeafNode in the supergroup.</t>
        <t><tt>prp_key</tt> is computed in a way that it is unique to the key-nonce pair and
computable by all the devices in a subgroup (but nobody else). <tt>reuse_guard</tt> is
computed in a way that it appears random to outside observers (in particular, it
does not leak which device sent the message), but two devices will never
generate the same value.</t>
      </section>
    </section>
    <section anchor="adding-new-devices">
      <name>Adding New Devices</name>
      <t>When a user adds a new authorized device to their account, there are several
pieces of cryptographic state that need to be synchronized before the device can
start sending and receiving messages. The device can either get this state from
another one of the user's devices, or if all of the user's other devices are
offline, the device can use a series of external joins to prepare itself.</t>
      <section anchor="synchronizing-from-another-device">
        <name>Synchronizing from Another Device</name>
        <t>If the new device is being added by another online device, this device sends a
Welcome message to the new device, adding the new device to the subgroup, that
contains a <tt>new_device_state</tt> extension in the GroupInfo:</t>
        <artwork><![CDATA[
opaque MLSState<V>;

enum {
  reserved(0),
  empty(1),
  present(2),
} SecretTreeNodeType;

struct {
  SecretTreeNodeType node_type;
  select(SecretTreeNode.node_type) {
    case empty:
      SecretTreeNode left;
      SecretTreeNode right;
    case present:
      opaque value<V>;
  }
} SecretTreeNode;

struct {
  uint64 epoch;
  SecretTreeNode root;
} EpochSecretTree;

struct {
  KeyPackageRef ref;
  opaque init_secret<V>;
  opaque leaf_secret<V>;
} KeyPackageKey;

struct {
  opaque signature_private_key<V>;
  opaque subgroup_extension_key<V>;
  EpochSecretTree secret_trees<V>;
  KeyPackageKey key_package_keys<V>;
  MLSState group_states<V>;
} NewDeviceState;
]]></artwork>
        <t>The <tt>signature_private_key</tt> contains the serialized signature private key of the
virtual client. Every device and virtual client <bcp14>SHOULD</bcp14> have distinct signature
keys. The <tt>subgroup_extension_key</tt> is the encryption key for the subgroup
extension (<xref target="subgroup-extension"/>). The <tt>secret_trees</tt> array contains the
serialized Secret Trees for any epochs where they may still be necessary. The
<tt>key_package_keys</tt> array contains the <tt>init_secret</tt> and <tt>leaf_secret</tt> for any
KeyPackages that are still unused but have been purged from the Secret Tree. And
finally, the <tt>group_states</tt> array contains the cryptographic states of all the
groups that the virtual client is a member of, serialized in an
application-specific way.</t>
      </section>
      <section anchor="joining-externally">
        <name>Joining Externally</name>
        <t>Without another online device to bootstrap from, the new device can follow these
steps to join externally:</t>
        <ol spacing="normal" type="1"><li>
            <t>Issue a credential for the virtual client with a new signature key and
generate a new subgroup extension key.</t>
          </li>
          <li>
            <t>Perform an External Join to the subgroup. Send an application message
containing a <tt>ResyncMessage</tt> to the subgroup with the new keys.</t>
          </li>
          <li>
            <t>Replace all unused KeyPackages with new KeyPackages, generated from the new
subgroup epoch.</t>
          </li>
          <li>
            <t>Perform an External Join to all of the groups that the virtual client is a
member of, using LeafNodes generated from the new subgroup epoch. Welcome
messages which were unprocessed by the offline devices are discarded, and
these groups are Externally Joined instead (potentially being queued for user
approval first).</t>
          </li>
        </ol>
        <artwork><![CDATA[
struct {
  opaque signature_private_key<V>;
  opaque subgroup_extension_key<V>;
} ResyncMessage;
]]></artwork>
        <t>Note that this involves changing the subgroup extension key. Devices that were
in the subgroup before the new device joined externally can determine whether to
use the new or old subgroup extension key by checking whether the new or old
credential is in the relevant LeafNode.</t>
        <t>Also note that the new device learns the set of groups that the virtual client
is a member of, including groups corresponding to unprocessed Welcome messages,
from the Delivery Service, which has access to this information as part of
supporting External Joins.</t>
      </section>
    </section>
    <section anchor="aligning-security-of-groups">
      <name>Aligning Security of Groups</name>
      <t>Subgroups deprive supergroup members of visibility into whether key rotation is
happening on a regular basis, and the extent to which compromised devices may
have access to group secrets. As such, subgroups need to enforce policies that
manage this concern.</t>
      <t>A subgroup <bcp14>MUST</bcp14> have either the same or a stronger policy on how frequently
devices must update their leaf node, than the groups that the virtual client is
a member of.</t>
      <t>Any time that a device is removed from a subgroup, an Update (or Commit with
<tt>path</tt> populated) <bcp14>MUST</bcp14> be sent to all groups that the virtual client is a member
of.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document defines two new MLS Extension Types, and a new MLS Exporter Label.</t>
      <section anchor="mls-extension-types">
        <name>MLS Extension Types</name>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Name</th>
              <th align="left">Message(s)</th>
              <th align="left">R</th>
              <th align="left">Ref</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">0x0006</td>
              <td align="left">subgroup</td>
              <td align="left">LN, KP</td>
              <td align="left">-</td>
              <td align="left">RFC XXXX</td>
            </tr>
            <tr>
              <td align="left">0x0007</td>
              <td align="left">new_device_state</td>
              <td align="left">GI</td>
              <td align="left">-</td>
              <td align="left">RFC XXXX</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="mls-exporter-labels">
        <name>MLS Exporter Labels</name>
        <table>
          <thead>
            <tr>
              <th align="left">Label</th>
              <th align="left">Recommended</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">"Subgroup Secret Tree"</td>
              <td align="left">-</td>
              <td align="left">RFC XXXX</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="NIST" target="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38G.pdf">
          <front>
            <title>Recommendation for Block Cipher Modes of Operation: Methods for Format-Preserving Encryption</title>
            <author initials="M." surname="Dworkin" fullname="Morris Dworkin">
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC9420">
          <front>
            <title>The Messaging Layer Security (MLS) Protocol</title>
            <author fullname="R. Barnes" initials="R." surname="Barnes"/>
            <author fullname="B. Beurdouche" initials="B." surname="Beurdouche"/>
            <author fullname="R. Robert" initials="R." surname="Robert"/>
            <author fullname="J. Millican" initials="J." surname="Millican"/>
            <author fullname="E. Omara" initials="E." surname="Omara"/>
            <author fullname="K. Cohn-Gordon" initials="K." surname="Cohn-Gordon"/>
            <date month="July" year="2023"/>
            <abstract>
              <t>Messaging applications are increasingly making use of end-to-end security mechanisms to ensure that messages are only accessible to the communicating endpoints, and not to any servers involved in delivering messages. Establishing keys to provide such protections is challenging for group chat settings, in which more than two clients need to agree on a key but may not be online at the same time. In this document, we specify a key establishment protocol that provides efficient asynchronous group key establishment with forward secrecy (FS) and post-compromise security (PCS) for groups in size ranging from two to thousands.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9420"/>
          <seriesInfo name="DOI" value="10.17487/RFC9420"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="I-D.ietf-mls-architecture">
          <front>
            <title>The Messaging Layer Security (MLS) Architecture</title>
            <author fullname="Benjamin Beurdouche" initials="B." surname="Beurdouche">
              <organization>Inria &amp; Mozilla</organization>
            </author>
            <author fullname="Eric Rescorla" initials="E." surname="Rescorla">
              <organization>Mozilla</organization>
            </author>
            <author fullname="Emad Omara" initials="E." surname="Omara">
         </author>
            <author fullname="Srinivas Inguva" initials="S." surname="Inguva">
         </author>
            <author fullname="Alan Duric" initials="A." surname="Duric">
              <organization>Wire</organization>
            </author>
            <date day="3" month="March" year="2024"/>
            <abstract>
              <t>   The Messaging Layer Security (MLS) protocol (I-D.ietf-mls-protocol)
   provides a Group Key Agreement protocol for messaging applications.
   MLS is meant to protect against eavesdropping, tampering, message
   forgery, and provide Forward Secrecy (FS) and Post-Compromise
   Security (PCS).

   This document describes the architecture for using MLS in a general
   secure group messaging infrastructure and defines the security goals
   for MLS.  It provides guidance on building a group messaging system
   and discusses security and privacy tradeoffs offered by multiple
   security mechanisms that are part of the MLS protocol (e.g.,
   frequency of public encryption key rotation).  The document also
   provides guidance for parts of the infrastructure that are not
   standardized by MLS and are instead left to the application.

   While the recommendations of this document are not mandatory to
   follow in order to interoperate at the protocol level, they affect
   the overall security guarantees that are achieved by a messaging
   application.  This is especially true in the case of active
   adversaries that are able to compromise clients, the delivery
   service, or the authentication service.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-mls-architecture-12"/>
        </reference>
      </references>
    </references>
    <?line 420?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61b/XIbN5L/H0+Bk/+wdEtSkuPKeuV8rGLJji62rLPs5LZS
KRGcAclZDweTAUY011ae5Z7lnuz6A8BghpSTXJ2qEpMzQKO70ej+dTc4Ho+F
K1ypT+Teq5fX8rqdLRrT1nZPZMrphWk2J7Ko5kaI3GSVWsHAvFFzN15lq6Is
C1ONV6Ud2zBvfHQk4MuqsBbeuU0NEy7O3z4XVbua6eZE5ED2RGSmsrqyrT2R
rmm1uD2RXwjVaAV8XOusbQq32RNr07wnssidtlYtimohX6qNbmQ36r3ewMD8
RNzqqgXaUv7+HCmZtb2fYAkc8AKn4POVKkp4DkL9vdBuPjHNAh+rJlvC46Vz
tT05PMRR+Ki41ZMw7BAfHM4as7b6EOYf4rxF4ZbtDGZ+1+jq0dHx0SGrz3aK
lrIEnViXkA+DJzx9UpjhtMPP7sJk6VblnhCqdUsDSpdjWEXKeVuWvIfETq4q
+Sp7xQT2aIT24s/4dST/9wW+mGRmBVQr06yUA9FR15cX129PaK5TzU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