
From nobody Sat Dec  4 23:56:06 2021
Return-Path: <do_not_reply@mnot.net>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BAB8A3A0ABD for <mls@ietfa.amsl.com>; Sat,  4 Dec 2021 23:55:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=VU7GVdx+; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=T2qaaM/Y
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yl6WBaQ-9Bar for <mls@ietfa.amsl.com>; Sat,  4 Dec 2021 23:55:54 -0800 (PST)
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 71BFE3A122D for <mls@ietf.org>; Sat,  4 Dec 2021 23:55:54 -0800 (PST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 6B4733200A2A for <mls@ietf.org>; Sun,  5 Dec 2021 02:39:15 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 05 Dec 2021 02:39:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h= content-type:mime-version:from:to:subject; s=fm1; bh=6wJlB+5Pzbl 0Tst4/Rm2RXKqT9w5e4qIkWgww4wOxuU=; b=VU7GVdx+ON62MrcMrqXDSXa6aOL iqsXAoDA9fD45pMiqgCFF5BJ7YwNCGHEPo3uhTfSMwXVQSNoELLq/BbM7pwBVB93 NXx8as3dBBPMMN5xC/80muHZGTRlrJecdJ6fVQNF47DwoIQAnM3NWXtxKN94ZL3V 4b9Vq4YqxhQgRFT0FB/dJ8cevAUH51HMvyO5/y0Imq3GABG9vVSV5Wn7T3r3SF5p 7OqMofB3Lun2lknfAfgIfvysiMEz4mZa6UA3permw4/juty66RnGwOLlPc5UHrg0 YyZckGAOwsnJCK9w8/aZHRZkIE1iY8DSpYLotjFZluZEm5P3mIS6veitatg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:from:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=6wJlB+5Pzbl0Tst4/Rm2RXKqT9w5e4qIkWgww4wOxuU=; b=T2qaaM/Y CZT/H59ktjRzbXcOHDTyNchjpCEtP50NzC1CjBaCtvO1JxY3ARSPskN6gJu6R1q2 xVOeGnht5XT5YUTaWCY/OxTVrvt8b7LgJRSUdU+/qg6PYoYeo0pYkMDhiANPJ506 eMcYTtToYFngvqa+y2QN/S57aSMAIKd9ot5bvpbp7YajswA49lmXGvWpptgE0OOW kUp6jZ7sWVdz6L2IzwGWWFlqoT41AoUpUDtDJMFxdZcfaPES98imXjeQ1vhUlhJH h2PaUFUEn8ZOCoWnGz7PDW+Sjq242IspupBtiflOb67GK22lcyUfNNd1VKvDgAKR BRg+DKaoeO05vA==
X-ME-Sender: <xms:omysYSjdlP49dIXuuhTE0mSzu0NayH5bMFewKPYrb_x7ptlH9fK82A> <xme:omysYTA26vxkGepKIjYWlxir4lsPyJp5_AALBN9kSwAQpWD66tUzZo1pK24ZT9zbQ wrpIanC1sRa066VSQ>
X-ME-Received: <xmr:omysYaGKCKgg_IlcHeYd5dSWrsuSNPIuwPgrD3LkhtC5QqyCkJt9-fBpmCOeKiCC2jmBqCUs36hT2k1UYhrl278VWbC2pp2wZZ-1__s_J9GUeny-oNSukvpMoSGY0JuKl502sA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjedtgddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucfpohcuuggrthgvuchfihgvlhguucdlgeelmdenuc fjughrpegtggfhvffusegrtddtredttdejnecuhfhrohhmpeftvghpohhsihhtohhrhicu tegtthhivhhithihucfuuhhmmhgrrhihuceuohhtuceoughopghnohhtpghrvghplhihse hmnhhothdrnhgvtheqnecuggftrfgrthhtvghrnhepkeefvdduteejvdefkeehieevuefg fefhteetveegffekffefteffvdelheduieetnecuffhomhgrihhnpehgihhthhhusgdrtg homhenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu ohgpnhhothgprhgvphhlhiesmhhnohhtrdhnvght
X-ME-Proxy: <xmx:omysYbQYf-ewWIJwHZRDQ3N-pmZ4jJDPl83TDlGItccrkn05lwfxgg> <xmx:omysYfwAg9u2HAh0wgNEWobJsS1P0dZgeYc_blt0S-svdazXS8o05A> <xmx:omysYZ5v4BqLp2y8Y7Ll6ld2nfiyj7T0nfuSS9eLzhXCP8SwrtxHDA> <xmx:omysYa-xtg6n5B_QSy8HB-doM1uyhKpHabKcxg_ZLQcNnkIrGa_H7Q>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for <mls@ietf.org>;  Sun, 5 Dec 2021 02:39:14 -0500 (EST)
Content-Type: multipart/alternative; boundary="===============9191967859719775141=="
MIME-Version: 1.0
From: Repository Activity Summary Bot <do_not_reply@mnot.net>
To: mls@ietf.org
Message-Id: <20211205075554.71BFE3A122D@ietfa.amsl.com>
Date: Sat,  4 Dec 2021 23:55:54 -0800 (PST)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/lMdAT1M7WggljLig6hIpanJh0_w>
Subject: [MLS] Weekly github digest (MLS Working Group summary)
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 05 Dec 2021 07:56:00 -0000

--===============9191967859719775141==
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"; format="flowed"




Issues
------
* mlswg/mls-protocol (+0/-13/=F0=9F=92=AC13)
  7 issues received 13 new comments:
  - #516 Discard pending Update proposals for the sender if a `path` is inc=
luded (4 by bifurcation, kkohbrok)
    https://github.com/mlswg/mls-protocol/issues/516=20
  - #502 Consolidate resumption PSK definitions (4 by bifurcation, kkohbrok=
, raphaelrobert)
    https://github.com/mlswg/mls-protocol/issues/502=20
  - #499 `typed` struct definition (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/issues/499=20
  - #482 Review advisory sections (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/issues/482 [editorial]=20
  - #409 Draft structure/Editorial Changes (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/issues/409 [editorial]=20
  - #365 Update security considerations (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/issues/365 [editorial]=20
  - #168 Clarify obligation of clients to Update (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/issues/168 [editorial] [security]=
 [recommendation]=20

  13 issues closed:
  - Clarify relationship between Ratchet Tree Evolution, Group Creation, an=
d Key Schedule https://github.com/mlswg/mls-protocol/issues/468 [editorial]=
=20
  - Motivate Ratchet Trees https://github.com/mlswg/mls-protocol/issues/447=
 [editorial]=20
  - Ciphersuite Addition https://github.com/mlswg/mls-protocol/issues/503=20
  - Add is unnecessary in external Commit https://github.com/mlswg/mls-prot=
ocol/issues/505=20
  - KeyPackage ID vs KeyPackage Identifier https://github.com/mlswg/mls-pro=
tocol/issues/504=20
  - Use smaller, fixed-size hash-based identifiers https://github.com/mlswg=
/mls-protocol/issues/506=20
  - Discard pending Update proposals for the sender if a `path` is included=
 https://github.com/mlswg/mls-protocol/issues/516=20
  - Discard pending Update proposals for the sender if a `path` is included=
 https://github.com/mlswg/mls-protocol/issues/516=20
  - Clarify obligation of clients to Update https://github.com/mlswg/mls-pr=
otocol/issues/168 [editorial] [security] [recommendation]=20
  - Update security considerations https://github.com/mlswg/mls-protocol/is=
sues/365 [editorial]=20
  - Review advisory sections https://github.com/mlswg/mls-protocol/issues/4=
82 [editorial]=20
  - `typed` struct definition https://github.com/mlswg/mls-protocol/issues/=
499=20
  - Update HPKE requirement to latest https://github.com/mlswg/mls-protocol=
/issues/500=20



Pull requests
-------------
* mlswg/mls-protocol (+5/-8/=F0=9F=92=AC10)
  5 pull requests submitted:
  - Add algorithms for link-based trees (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/521=20
  - Revamp overview sections (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/520=20
  - Forbid self-Update entirely (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/519=20
  - Consolidate resumption PSK cases (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/518=20
  - Recommend against self-Update proposals in Commit (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/517=20

  4 pull requests received 10 new comments:
  - #521 Add algorithms for link-based trees (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/521=20
  - #515 Add protocol version to PGS (1 by kkohbrok)
    https://github.com/mlswg/mls-protocol/pull/515=20
  - #509 Be explicit that Credentials can attest to multiple identities (3 =
by bifurcation, kkohbrok, raphaelrobert)
    https://github.com/mlswg/mls-protocol/pull/509=20
  - #507 Getting rid of the array representation (5 by TWal, bifurcation, f=
ranziskuskiefer)
    https://github.com/mlswg/mls-protocol/pull/507=20

  8 pull requests merged:
  - Two editorial issues
    https://github.com/mlswg/mls-protocol/pull/513=20
  - 384 Ciphersuite Addition
    https://github.com/mlswg/mls-protocol/pull/514=20
  - Remove the requirement for Add in external commit
    https://github.com/mlswg/mls-protocol/pull/511=20
  - Use smaller, fixed-size hash-based identifiers
    https://github.com/mlswg/mls-protocol/pull/510=20
  - Forbid self-Update entirely
    https://github.com/mlswg/mls-protocol/pull/519=20
  - Recommend against self-Update proposals in Commit
    https://github.com/mlswg/mls-protocol/pull/517=20
  - Remove explicit version pin on HPKE
    https://github.com/mlswg/mls-protocol/pull/512=20
  - Add protocol version to PGS
    https://github.com/mlswg/mls-protocol/pull/515=20


Repositories tracked by this digest:
-----------------------------------
* https://github.com/mlswg/mls-architecture
* https://github.com/mlswg/mls-protocol
* https://github.com/mlswg/mls-federation

--===============9191967859719775141==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<!doctype html>
<html lang=3D"en">
<head>
<meta charset=3D"utf-8">
<title>Weekly github digest (MLS Working Group summary)</title>
<style>
body { font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;=
 font-size: 14px; }
h2 { margin-top: 3em; color: #A52A2A; font-style: italic; font-weight: norm=
al; }
h3 { margin-bottom:0; margin-top: 2em; font-size: 1.2em; }
h1+h2 { margin-top: 1em; }
a { color: #bb6219; text-decoration: none; }
li { margin-bottom: .35em; }
.repos { margin-bottom: 0; margin-top:0; line-height: 1.2; }
.new { color: red; }
.label { display: inline;
	padding: .2em .6em .3em;
	font-size: 75%;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: .25em;
}
details {
	margin-top: 8em;
	}
summary {
	margin-bottom: 1em;
	cursor: pointer;
}
</style>
</head>

<body>
<h1>Sunday December 05, 2021</h1>


<h2>Issues</h2>

<h3>mlswg/mls-protocol (+0/-13/=F0=9F=92=AC13)</h3>

  <p>7 issues received 13 new comments:</p>
  <ul>
  <li>#516 <a href=3D"https://github.com/mlswg/mls-protocol/issues/516">Dis=
card pending Update proposals for the sender if a `path` is included</a> (4=
 by bifurcation, kkohbrok) </li>
 =20
  <li>#502 <a href=3D"https://github.com/mlswg/mls-protocol/issues/502">Con=
solidate resumption PSK definitions</a> (4 by bifurcation, kkohbrok, raphae=
lrobert) </li>
 =20
  <li>#499 <a href=3D"https://github.com/mlswg/mls-protocol/issues/499">`ty=
ped` struct definition</a> (1 by bifurcation) </li>
 =20
  <li>#482 <a href=3D"https://github.com/mlswg/mls-protocol/issues/482">Rev=
iew advisory sections</a> (1 by bifurcation) <span class=3D"label" style=3D=
"background-color: #ffc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#409 <a href=3D"https://github.com/mlswg/mls-protocol/issues/409">Dra=
ft structure/Editorial Changes</a> (1 by bifurcation) <span class=3D"label"=
 style=3D"background-color: #ffc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#365 <a href=3D"https://github.com/mlswg/mls-protocol/issues/365">Upd=
ate security considerations</a> (1 by bifurcation) <span class=3D"label" st=
yle=3D"background-color: #ffc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#168 <a href=3D"https://github.com/mlswg/mls-protocol/issues/168">Cla=
rify obligation of clients to Update</a> (1 by bifurcation) <span class=3D"=
label" style=3D"background-color: #ffc6d6; color: #000000">editorial</span>=
 <span class=3D"label" style=3D"background-color: #ce373a; color: #ffffff">=
security</span> <span class=3D"label" style=3D"background-color: #f7c9b7; c=
olor: #000000">recommendation</span> </li>
  </ul>

  <p>13 issues closed:</p>
  <ul>
  <li>#468 <a href=3D"https://github.com/mlswg/mls-protocol/issues/468">Cla=
rify relationship between Ratchet Tree Evolution, Group Creation, and Key S=
chedule</a> <span class=3D"label" style=3D"background-color: #ffc6d6; color=
: #000000">editorial</span> </li>
 =20
  <li>#447 <a href=3D"https://github.com/mlswg/mls-protocol/issues/447">Mot=
ivate Ratchet Trees</a> <span class=3D"label" style=3D"background-color: #f=
fc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#503 <a href=3D"https://github.com/mlswg/mls-protocol/issues/503">Cip=
hersuite Addition</a> </li>
 =20
  <li>#505 <a href=3D"https://github.com/mlswg/mls-protocol/issues/505">Add=
 is unnecessary in external Commit</a> </li>
 =20
  <li>#504 <a href=3D"https://github.com/mlswg/mls-protocol/issues/504">Key=
Package ID vs KeyPackage Identifier</a> </li>
 =20
  <li>#506 <a href=3D"https://github.com/mlswg/mls-protocol/issues/506">Use=
 smaller, fixed-size hash-based identifiers</a> </li>
 =20
  <li>#516 <a href=3D"https://github.com/mlswg/mls-protocol/issues/516">Dis=
card pending Update proposals for the sender if a `path` is included</a> </=
li>
 =20
  <li>#516 <a href=3D"https://github.com/mlswg/mls-protocol/issues/516">Dis=
card pending Update proposals for the sender if a `path` is included</a> </=
li>
 =20
  <li>#168 <a href=3D"https://github.com/mlswg/mls-protocol/issues/168">Cla=
rify obligation of clients to Update</a> <span class=3D"label" style=3D"bac=
kground-color: #ffc6d6; color: #000000">editorial</span> <span class=3D"lab=
el" style=3D"background-color: #ce373a; color: #ffffff">security</span> <sp=
an class=3D"label" style=3D"background-color: #f7c9b7; color: #000000">reco=
mmendation</span> </li>
 =20
  <li>#365 <a href=3D"https://github.com/mlswg/mls-protocol/issues/365">Upd=
ate security considerations</a> <span class=3D"label" style=3D"background-c=
olor: #ffc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#482 <a href=3D"https://github.com/mlswg/mls-protocol/issues/482">Rev=
iew advisory sections</a> <span class=3D"label" style=3D"background-color: =
#ffc6d6; color: #000000">editorial</span> </li>
 =20
  <li>#499 <a href=3D"https://github.com/mlswg/mls-protocol/issues/499">`ty=
ped` struct definition</a> </li>
 =20
  <li>#500 <a href=3D"https://github.com/mlswg/mls-protocol/issues/500">Upd=
ate HPKE requirement to latest</a> </li>
  </ul>



<h2>Pull requests</h2>
<h3>mlswg/mls-protocol (+5/-8/=F0=9F=92=AC10)</h3>
  <p class=3D"new">5 pull requests submitted:</p>
  <ul>
  <li>#521 <a href=3D"https://github.com/mlswg/mls-protocol/pull/521">Add a=
lgorithms for link-based trees</a> (by bifurcation) </li>
 =20
  <li>#520 <a href=3D"https://github.com/mlswg/mls-protocol/pull/520">Revam=
p overview sections</a> (by bifurcation) </li>
 =20
  <li>#519 <a href=3D"https://github.com/mlswg/mls-protocol/pull/519">Forbi=
d self-Update entirely</a> (by bifurcation) </li>
 =20
  <li>#518 <a href=3D"https://github.com/mlswg/mls-protocol/pull/518">Conso=
lidate resumption PSK cases</a> (by bifurcation) </li>
 =20
  <li>#517 <a href=3D"https://github.com/mlswg/mls-protocol/pull/517">Recom=
mend against self-Update proposals in Commit</a> (by bifurcation) </li>
  </ul>

  <p>4 pull requests received 10 new comments:</p>
  <ul>
  <li>#521 <a href=3D"https://github.com/mlswg/mls-protocol/pull/521">Add a=
lgorithms for link-based trees</a> (1 by bifurcation) </li>
 =20
  <li>#515 <a href=3D"https://github.com/mlswg/mls-protocol/pull/515">Add p=
rotocol version to PGS</a> (1 by kkohbrok) </li>
 =20
  <li>#509 <a href=3D"https://github.com/mlswg/mls-protocol/pull/509">Be ex=
plicit that Credentials can attest to multiple identities</a> (3 by bifurca=
tion, kkohbrok, raphaelrobert) </li>
 =20
  <li>#507 <a href=3D"https://github.com/mlswg/mls-protocol/pull/507">Getti=
ng rid of the array representation</a> (5 by TWal, bifurcation, franziskusk=
iefer) </li>
  </ul>

  <p>8 pull requests merged:</p>
  <ul>
  <li>#513 <a href=3D"https://github.com/mlswg/mls-protocol/pull/513">Two e=
ditorial issues</a> </li>
 =20
  <li>#514 <a href=3D"https://github.com/mlswg/mls-protocol/pull/514">384 C=
iphersuite Addition</a> </li>
 =20
  <li>#511 <a href=3D"https://github.com/mlswg/mls-protocol/pull/511">Remov=
e the requirement for Add in external commit</a> </li>
 =20
  <li>#510 <a href=3D"https://github.com/mlswg/mls-protocol/pull/510">Use s=
maller, fixed-size hash-based identifiers</a> </li>
 =20
  <li>#519 <a href=3D"https://github.com/mlswg/mls-protocol/pull/519">Forbi=
d self-Update entirely</a> </li>
 =20
  <li>#517 <a href=3D"https://github.com/mlswg/mls-protocol/pull/517">Recom=
mend against self-Update proposals in Commit</a> </li>
 =20
  <li>#512 <a href=3D"https://github.com/mlswg/mls-protocol/pull/512">Remov=
e explicit version pin on HPKE</a> </li>
 =20
  <li>#515 <a href=3D"https://github.com/mlswg/mls-protocol/pull/515">Add p=
rotocol version to PGS</a> </li>
  </ul>


  <details>
    <summary>Repositories tracked by this digest:</summary>
<ul class=3D"repos">
  <li><a href=3D"https://github.com/mlswg/mls-architecture">https://github.=
com/mlswg/mls-architecture</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-protocol">https://github.com/=
mlswg/mls-protocol</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-federation">https://github.co=
m/mlswg/mls-federation</a></li>
</ul>
</details>
</body>
</html>

--===============9191967859719775141==--


From nobody Tue Dec  7 07:19:17 2021
Return-Path: <rlb@ipv.sx>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 27F123A082A for <mls@ietfa.amsl.com>; Tue,  7 Dec 2021 07:19:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level: 
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20210112.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 54bYplm_mXOk for <mls@ietfa.amsl.com>; Tue,  7 Dec 2021 07:19:14 -0800 (PST)
Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 238E83A16D0 for <mls@ietf.org>; Tue,  7 Dec 2021 07:19:13 -0800 (PST)
Received: by mail-qk1-x72b.google.com with SMTP id g28so14910377qkk.9 for <mls@ietf.org>; Tue, 07 Dec 2021 07:19:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20210112.gappssmtp.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=lsPpkVgx/ylkFWBgPWy+pGuQNg7Tfp/W0bFBHpTI9m8=; b=0r6KxABeTtWwFvFG4ikF8YhXaUOXEGLgwjt9XYWM7E8Wdsph5LzuzBEfIsPl7T6bfH gzJR2wtRGpiGkY48l9eCJTj1k0HluMtvt4/kI9BJKHzfOYASG+WTJKrJ8Vrid4RozfgL YoX71adaR3XAoep8oeUJITFbGgNjhjgyiv5HX5TceQFDOh5xbRABuVTL5GORiyyLF84G lhKLBMRzH/l5nr/y4ZSsMWq0GfODPp7k+PiVPJwntkf+m/Un4QHMeNnI/PHazPLLYi8p jhbUsBBGfabkHXhN8FrsbVj5UQowNWmaLEIDeG1i83KiP/14TgrMvFiwDBd47lUVEowA P/rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=lsPpkVgx/ylkFWBgPWy+pGuQNg7Tfp/W0bFBHpTI9m8=; b=vblhwkta8RJWSkD1dyzZ48Iqw/rja1oCJ/ivPiRvlqS+URXf/EbkthJ08QKsh917pE zvpZ/XSDMMUIP/eMIpsNeCMFSho22DhdCBLnpB3MWJ3OsS448xvXDr4YBrNaskdYbfSP ff5Ils18NfyLz/Sa/CsUq7z65MAU8FkKoPUVdzWu8ww8TFY/pFxGTg06i/KzH1LF6ZIL r8ODvCUmkjdwgBdMMGY2zen76DCvNPKRJe8uJ9+I4MHIFl23q25rGQWk8BqNABp1rGEX eyFxhBPsQS6A6dPG++lXp2ciC+3PcTqUW8y8g2XD5Zyq7yNDkQF0SYon8AfNMKYfZVP6 JdrQ==
X-Gm-Message-State: AOAM531+h83O/SOJKl6RUi8sttMUav3IR0d9DxBnXeMLmqyF+zL6q55T UHt823pBEeZDcrOEmS4baHWPghiDDLh2XkF5UT+7j8Ij/Oi7Y5EZ
X-Google-Smtp-Source: ABdhPJxjqyaiL4r3ElprWrHoElRfnROEjwSwJkyqw5sCdb4zSbLUzoiTndudBy6CSW8JcYj1x1allj6CUSxfRuapuGA=
X-Received: by 2002:a05:620a:20da:: with SMTP id f26mr41796397qka.344.1638890346890;  Tue, 07 Dec 2021 07:19:06 -0800 (PST)
MIME-Version: 1.0
From: Richard Barnes <rlb@ipv.sx>
Date: Tue, 7 Dec 2021 10:18:55 -0500
Message-ID: <CAL02cgQWqDp-rRr8j+VyxceaD+cKY3BET5swwvC5JiuGra=29A@mail.gmail.com>
To: Messaging Layer Security WG <mls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000f40b1a05d28fe441"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/VAHaxl2tvqnpSAnTV2sv-ABcpB4>
Subject: [MLS] Last (?) batch of pre-WGLC changes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Dec 2021 15:19:16 -0000

--000000000000f40b1a05d28fe441
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hey MLS folks,

There's been a fair bit of GitHub activity recently getting things tuned up
for WGLC.  (Thanks to Konrad, Th=C3=A9ophile, Franziskus, Raphael, Britta, =
et
al. for some good discussions!)  There are a few remaining PRs with
significant changes that I wanted to raise for feedback before we merge and
ship.

I have listed the PRs below with links and short summaries.  If folks could
please post feedback on the PRs by the end of this week, it would be
appreciated.

Thanks,
--Richard

#518 - Consolidate resumption PSK cases
https://github.com/mlswg/mls-protocol/pull/518
Currently, when resumption PSKs are used, they are tagged as "reinit" or
"branch" PSKs.  This PR removes that distinction, on the premise that (a)
we don't have a good taxonomy of use cases for resumption PSKs (in
particular, "branch" and "reinit" are not the only cases), and (b)
use-case-specific PSKs can be added back in an extension.

#509 - Be explicit that Credentials can attest to multiple identities
https://github.com/mlswg/mls-protocol/pull/509
Earlier versions of the spec had a notion that a credential provides a
single identity, which is clearly wrong for things like X.509 certificates,
which can associate several identities to a public key.  This PR makes the
identity provisions more flexible, while maintaining the `endpoint_id`
field as a persistent identifier for a client in the scope of a group.

#522 - Generalize tree extend/truncate algorithms
https://github.com/mlswg/mls-protocol/pull/522
This PR started from a desire to make clear that the array-based tree
representation is not mandatory.  The main dependency on the array
representation was in describing how to add and remove leaves, so this PR
adds an abstract description of adding and removing leaves, and appendices
describing how to do it in "array-based" and "link-based" tree
representations.

#520 - Revamp overview sections
https://github.com/mlswg/mls-protocol/pull/520
This PR provides a new, more detailed overview section, to help give
readers a better framework for understanding the details in the rest of the
document.  In addition to this PR, I plan to re-order some sections before
the next draft, so that the flow is a little more logical (
https://github.com/mlswg/mls-protocol/issues/409#issuecomment-983853380).
But that will just be moving text, not changing anything, and will come
after all the substantive PRs are landed.

--000000000000f40b1a05d28fe441
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hey MLS folks,</div><div><br></div><div>There&#39;s b=
een a fair bit of GitHub activity recently getting things tuned up for WGLC=
.=C2=A0 (Thanks to Konrad, Th=C3=A9ophile, Franziskus, Raphael, Britta, et =
al. for some good discussions!)=C2=A0 There are a few remaining PRs with si=
gnificant changes that I wanted to raise for feedback before we merge and s=
hip.</div><div><br></div><div>I have listed the PRs below with links and sh=
ort summaries.=C2=A0 If folks could please post feedback on the PRs by the =
end of this week, it would be appreciated.</div><div><br></div><div>Thanks,=
</div><div>--Richard<br></div><div><br></div><div>#518 - Consolidate resump=
tion PSK cases<br></div><div><a href=3D"https://github.com/mlswg/mls-protoc=
ol/pull/518">https://github.com/mlswg/mls-protocol/pull/518</a></div><div>C=
urrently, when resumption PSKs are used, they are tagged as &quot;reinit&qu=
ot; or &quot;branch&quot; PSKs.=C2=A0 This PR removes that distinction, on =
the premise that (a) we don&#39;t have a good taxonomy of use cases for res=
umption PSKs (in particular, &quot;branch&quot; and &quot;reinit&quot; are =
not the only cases), and (b) use-case-specific PSKs can be added back in an=
 extension.<br></div><div><br></div><div>#509 - Be explicit that Credential=
s can attest to multiple identities<br></div><div><a href=3D"https://github=
.com/mlswg/mls-protocol/pull/509">https://github.com/mlswg/mls-protocol/pul=
l/509</a></div><div>Earlier versions of the spec had a notion that a creden=
tial provides a single identity, which is clearly wrong for things like X.5=
09 certificates, which can associate several identities to a public key.=C2=
=A0 This PR makes the identity provisions more flexible, while maintaining =
the `endpoint_id` field as a persistent identifier for a client in the scop=
e of a group.<br></div><div><br></div><div>#522 - Generalize tree extend/tr=
uncate algorithms<br></div><div><a href=3D"https://github.com/mlswg/mls-pro=
tocol/pull/522">https://github.com/mlswg/mls-protocol/pull/522</a></div><di=
v>This PR started from a desire to make clear that the array-based tree rep=
resentation is not mandatory.=C2=A0 The main dependency on the array repres=
entation was in describing how to add and remove leaves, so this PR adds an=
 abstract description of adding and removing leaves, and appendices describ=
ing how to do it in &quot;array-based&quot; and &quot;link-based&quot; tree=
 representations.<br></div><div><br></div><div>#520 - Revamp overview secti=
ons</div><div><a href=3D"https://github.com/mlswg/mls-protocol/pull/520">ht=
tps://github.com/mlswg/mls-protocol/pull/520</a></div><div>This PR provides=
 a new, more detailed overview section, to help give readers a better frame=
work for understanding the details in the rest of the document.=C2=A0 In ad=
dition to this PR, I plan to re-order some sections before the next draft, =
so that the flow is a little more logical (<a href=3D"https://github.com/ml=
swg/mls-protocol/issues/409#issuecomment-983853380">https://github.com/mlsw=
g/mls-protocol/issues/409#issuecomment-983853380</a>).=C2=A0 But that will =
just be moving text, not changing anything, and will come after all the sub=
stantive PRs are landed.<br></div><div><br></div></div>

--000000000000f40b1a05d28fe441--


From nobody Fri Dec 10 04:17:42 2021
Return-Path: <konrad.kohbrok@datashrine.de>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A5B8D3A0B1F for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 04:17:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=datashrine.de
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Infc5sWaJV0V for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 04:17:31 -0800 (PST)
Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 168543A0ADD for <mls@ietf.org>; Fri, 10 Dec 2021 04:17:29 -0800 (PST)
Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4J9VJx55mhzQjYK for <mls@ietf.org>; Fri, 10 Dec 2021 13:17:21 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datashrine.de; s=MBO0001; t=1639138639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RgJmqvOiuCau2mrw1S8+Ofn6IT/Zy8WnbXkCTVT8A+c=; b=VAYtMwz0G2HiTx/gLKxjeydgI3XeIP4ThubpZpo632U55UBDyY57h+PSAsoHQGAszySnm6 rPuLZjZDF1vo2bfqXr2ofE+R2qMSKmTqYCo6dr+RrHVHyWzH94SizrP7QHXaAJe0cyqIXY 41u6GQ249MjDZMbYA6eLRVUWRx+SwskAnGfO7z1KIuMNnBtbO4W60KF1qdDirOsAp1vQ8r CSVpNaYk3ldtAsF3VPraF4hi3hAPi6xWgu/yAePSoxqtO2Al4ibgaN+dgihpjiVOGlZvGp q3yMTpTZLvossWA/3iqJAueixgsDxrWy35mfoujL2tflITbnXFtgxaQBVmdI6Q==
Message-ID: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de>
Date: Fri, 10 Dec 2021 13:17:16 +0100
MIME-Version: 1.0
Content-Language: en-US
To: mls@ietf.org
From: Konrad Kohbrok <konrad.kohbrok@datashrine.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/P8CiOeQy3lev7s5vbnaRkPwRa1Q>
Subject: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Dec 2021 12:17:41 -0000

Hi everyone,



while testing changes to our tree implementation, we found what we 
believe is a bug in the specification. More concretely, the tree 
truncation mandated by the spec is too aggressive and can destroy parent 
hashes in an otherwise valid tree.



For debugging purposes, we had a check that would validate parent hashes 
of every node every time a commit is processed, which is how we found 
the bug.



Currently, the spec mandates that upon a remove operation, the leaves 
are removed until the right-most leaf in non-blank. However, this can 
lead to a situation, where non-blank parent nodes of a non-blank leaf 
are removed. This removal potentially interrupts valid 
"parent-hash-chains". More concretely, if the affected leaf node was the 
last node to commit a path in its subtree, then overly aggressive 
truncation can lead to the removal of parent nodes in that path. This in 
turn leads to an error when the parent hash of the parent of the removed 
parent node is verified. Note that if the parent hash chain is 
interrupted in this way, the situation is indistinguishable from one 
where the parent hash of a node is simply invalid.



Consider the following example:



                               15

                 _______________|

                /                |

               7                 |

         ______|______           |

        /             \          |

       3              11         |

     __|__           __|__       |

    /     \         /     \      |

   1       5       9      13     |

  / \     / \     / \     / \    |

A   B   C   D   E   F   G   -   I



                     1 1 1 1 1 1 1

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6



- G performs an update, leading to a valid parent hash chain along its 
direct path (13, 11, 7, 15).

- A removes I, leading to the following state, since G is the right-most 
non-blank leaf.





               7

         ______|______

        /             \

       3              11

     __|__           __|

    /     \         /   \

   1       5       9     |

  / \     / \     / \    |

A   B   C   D   E   F   G



                     1 1 1

0 1 2 3 4 5 6 7 8 9 0 1 2



- Since we have removed 13 in the process of removing (leaf) node 14, 
verification of the parent hash of node 11 will now fail, since none of 
its children carries its hash in its parent hash field.

- This will become apparent if a new member is added, either by one of 
the nodes A-D or by any node without a path.



As solution, we propose that the right-most leaf is only removed in the 
process of truncation if both it _and its parent_ are blank.





Raphael pointed out that this "careful" truncation leads to sparser 
trees and thus makes the protocol overall less efficient (larger tree 
structures need to be stored, longer direct paths with more secrets and 
key pairs to derive, etc.).



We can fix this by having two forms of truncation: A "careful" one, as 
described above and the one that is already in the spec right now with 
one caveat.



The careful one replaces the one that is currently described in the spec 
and is thus performed with each removal operation.



The one that we have right now is performed before a committer (or the 
receiver of a commit) applies a direct path, except that it can only 
remove nodes that are in the direct path of the committer.



This should allow us to get the smallest tree that we can without 
compromising valid parent hash chains.



Cheers,

Konrad


From nobody Fri Dec 10 08:29:55 2021
Return-Path: <rlb@ipv.sx>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A30553A07DD for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 08:29:53 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level: 
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20210112.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wLVyobIXevzE for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 08:29:48 -0800 (PST)
Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A5E1D3A07D7 for <mls@ietf.org>; Fri, 10 Dec 2021 08:29:48 -0800 (PST)
Received: by mail-qv1-xf30.google.com with SMTP id g9so8458493qvd.2 for <mls@ietf.org>; Fri, 10 Dec 2021 08:29:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Ycsc+9B9Qrxkmtl2ebxy4+InG/fr7sf0BvuNkG2ZX4=; b=KP7Xy5WZp93gIctiVubvpARZybq71IkUtq0Ojyim8rogLm+n/29xfsXPCoDdX+qJfU CwcFwtpX8sOazR+WkXyqUui4OOueHn1NYQ8PN+Qok5h2WlQQSz1zrlMeiHxG1CFIzebX CNFaOjIJONoHrOg6Tczj4Y7SVqHU6KJfESMEFuvBsk1z6NzagGHTeU6caFrKNO6WVkWN qy5R9Btuihrn2FlOsht7S50QygnNldPWCcvYsVWr3UlcoXmKuD3RdifttbNBIC2CEXvV +VyoSeEKZv5wPAzJssRU4IeAuDxeQqhpQMpbySiiHV1Z3FVTxb4NA9nYx0UoIflj4Bhr 5DDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Ycsc+9B9Qrxkmtl2ebxy4+InG/fr7sf0BvuNkG2ZX4=; b=djeno2tJZy9vW+vsjuvQQlhsiOG2PXe2kF4v3gMXR9UPMfrum3KtCfCPMfkBjn0l8m 0KCWRaXr7jou77JILCOQcNXBXN8/bh3jp9qh7qvyddRIfMMQXSFMYfp665E2gKTxxcQT 3XgwRNhceIRP65z5mdSzKRlvBGuKqYfEhcXY6whRrODVrEXtWzRdS7YPiyFYIziYyvmk VxLUu1XWM8wMhxfLGElLdjg3Eb0L6HqRp55ymQis0BcL88QfPbJcreD3+DbQmrpn4AH+ Rbu1ZsVJfGWk+CmOH6AGW6fiuD44ytTPCZk3YZ7XYVHZadRc7+ykFcZeotWhVhA/HRBl jQ1A==
X-Gm-Message-State: AOAM530wRoh/QFDFM1tltZKc1MI7MxsViT0TsdMTmlyiyf1FpZwbNNwm Kl7EZvDJOCkULJSSxLs/9JW+g9XqnTDG/tyANQlitX9vet2c96W9
X-Google-Smtp-Source: ABdhPJxVJVVfXlIvBMKrZBOB3Xo/Mz1Q1Y6WGsvIRMD8lNB6DqqLXwsmOqH/qyomZERQiy+pHLsXRnaambsHs7dyh44=
X-Received: by 2002:ad4:5bc6:: with SMTP id t6mr28028530qvt.15.1639153786765;  Fri, 10 Dec 2021 08:29:46 -0800 (PST)
MIME-Version: 1.0
References: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de>
In-Reply-To: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de>
From: Richard Barnes <rlb@ipv.sx>
Date: Fri, 10 Dec 2021 11:29:35 -0500
Message-ID: <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com>
To: Konrad Kohbrok <konrad.kohbrok@datashrine.de>
Cc: mls@ietf.org
Content-Type: multipart/alternative; boundary="00000000000031735b05d2cd3bc6"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/V4-wL-OemJFahxXK5GDRpqoMqtc>
Subject: Re: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Dec 2021 16:29:54 -0000

--00000000000031735b05d2cd3bc6
Content-Type: text/plain; charset="UTF-8"

Hi Konrad,

Thanks for thinking through this.  I mocked this up as a test case in
mlspp, and I can confirm that it breaks there too.

https://github.com/cisco/mlspp/compare/truncate-parent?expand=1

A couple of thoughts here...

# Putting blanks in update paths

It occurs to me that there is a different solution approach available here,
which preserves the sparsity of the tree, and even makes commits a little
more
efficient in some cases.

The starting point here is to observe that the current update path algorithm
adds useless intermediate nodes.  The reason the parent hash fails in your
example is that G added a useless intermediate node.  Since G is the only
child
of 13, that node could just as well have been left blank.  The resolution
algorithm would then result in the same number of encryptions when someone
elsewhere in the tree updated.

This is a small fix to the update path generation / processing algorithms.
When
the resolution of the copath node is empty, you simply set the parent node
to a
blank node instead of a populated parent node.

For the parent hash computation: Since blank nodes are all the same for
parent
hash, if the receiver of a tree knows where to put the blanks, then it can
add
them into the parent hash computation.  So the main work here would be to
(1)
update the parent hash algorithm so that it can cover blank nodes, and (2)
add
some syntax to the ParentHash extension that describes where the blanks
go.  If
we still had a notion of node indices, you could state it that way; less
clear
how to do it otherwise.

To work through an example: Suppose we have the following tree, in which G
has
just sent a commit to remove H.  The direct path sent by G resets nodes 12,
13,
11, 7, and 15, but sets node 13 to a blank because its copath resolution is
blank.

                                15
                 _______________|
                /                \
               7                 |
         ______|______           |
        /             \          |
       3              11         |
     __|__           __|__       |
    /     \         /     \      |
   1       5       9       _     |
  / \     / \     / \     / \    |
 A   B   C   D   E   F   G   _   I

                     1 1 1 1 1 1 1
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

The parent hash at G is thus over the path (12, _, 11, 7, 15).  We will
assume
that G's parent hash extension indicates that there is a blank in its direct
path between 12 and 11.

Now suppose as in your example that A removes I, so that you end up with the
same tree as in your example.

               7
         ______|______
        /             \
       3              11
     __|__           __|
    /     \         /   \
   1       5       9     |
  / \     / \     / \    |
 A   B   C   D   E   F   G

                     1 1 1
 0 1 2 3 4 5 6 7 8 9 0 1 2

A recipient seeing this tree can recognize that node 11 is covered by G's
parent
hash, because it will add a virtual blank node when computing the parent
hash
from 11 to G.

Now, that's pretty complicated, especially when you work out the details.
So
I'm not sure it's the right answer.  Just wanted to put it out there in the
interest of completeness.

# Exponential delete

I don't think your proposed careful delete solution actually works.  You
need
not only the parent node to be blank, but the whole path to the root.  I'll
assert that without proof for now, because the counterexample requires an
inconveniently large tree :)

Fortunately, that idea turns into an algorithm that's even simpler: Only
truncate the tree by removing the whole right side of it.  In the example
above,
after I gets removed, you would keep the blank leaf at node 14, and move the
root of the tree to node 7.  In an even sparser example:

                                15
                 _______________|
                /                \
               7                 |
         ______|______           |
        /             \          |
       3               _         |
     __|__           __|__       |
    /     \         /     \      |
   1       _       _       _     |
  / \     / \     / \     / \    |
 A   B   _   _   _   _   _   _   I

                     1 1 1 1 1 1 1
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

... after removing I you would first chop down to 0..14, then 0..6, then
0..2.
While root.right.empty(), root = root.left.

The overall semantic would then be that the tree grows linearly, but shrinks
exponentially.  (Like TCP!)  That obviously keeps bigger trees around for
longer, but it ultimately gets the job done.  And an implementation that
really
cares can use Remove+Add move operations to compact the tree.

# ...

Overall, I think my preference here would be to go with the exponential
delete
option. Adding blanks in the parent hash is nice in that it saves some
work, but
the details seem intimidatingly complicated. Exponential delete is a simple,
easy-to-understand solution that still GC's the tree, just more slowly.

--Richard

On Fri, Dec 10, 2021 at 7:18 AM Konrad Kohbrok <konrad.kohbrok@datashrine.de>
wrote:

> Hi everyone,
>
>
>
> while testing changes to our tree implementation, we found what we
> believe is a bug in the specification. More concretely, the tree
> truncation mandated by the spec is too aggressive and can destroy parent
> hashes in an otherwise valid tree.
>
>
>
> For debugging purposes, we had a check that would validate parent hashes
> of every node every time a commit is processed, which is how we found
> the bug.
>
>
>
> Currently, the spec mandates that upon a remove operation, the leaves
> are removed until the right-most leaf in non-blank. However, this can
> lead to a situation, where non-blank parent nodes of a non-blank leaf
> are removed. This removal potentially interrupts valid
> "parent-hash-chains". More concretely, if the affected leaf node was the
> last node to commit a path in its subtree, then overly aggressive
> truncation can lead to the removal of parent nodes in that path. This in
> turn leads to an error when the parent hash of the parent of the removed
> parent node is verified. Note that if the parent hash chain is
> interrupted in this way, the situation is indistinguishable from one
> where the parent hash of a node is simply invalid.
>
>
>
> Consider the following example:
>
>
>
>                                15
>
>                  _______________|
>
>                 /                |
>
>                7                 |
>
>          ______|______           |
>
>         /             \          |
>
>        3              11         |
>
>      __|__           __|__       |
>
>     /     \         /     \      |
>
>    1       5       9      13     |
>
>   / \     / \     / \     / \    |
>
> A   B   C   D   E   F   G   -   I
>
>
>
>                      1 1 1 1 1 1 1
>
> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>
>
>
> - G performs an update, leading to a valid parent hash chain along its
> direct path (13, 11, 7, 15).
>
> - A removes I, leading to the following state, since G is the right-most
> non-blank leaf.
>
>
>
>
>
>                7
>
>          ______|______
>
>         /             \
>
>        3              11
>
>      __|__           __|
>
>     /     \         /   \
>
>    1       5       9     |
>
>   / \     / \     / \    |
>
> A   B   C   D   E   F   G
>
>
>
>                      1 1 1
>
> 0 1 2 3 4 5 6 7 8 9 0 1 2
>
>
>
> - Since we have removed 13 in the process of removing (leaf) node 14,
> verification of the parent hash of node 11 will now fail, since none of
> its children carries its hash in its parent hash field.
>
> - This will become apparent if a new member is added, either by one of
> the nodes A-D or by any node without a path.
>
>
>
> As solution, we propose that the right-most leaf is only removed in the
> process of truncation if both it _and its parent_ are blank.
>
>
>
>
>
> Raphael pointed out that this "careful" truncation leads to sparser
> trees and thus makes the protocol overall less efficient (larger tree
> structures need to be stored, longer direct paths with more secrets and
> key pairs to derive, etc.).
>
>
>
> We can fix this by having two forms of truncation: A "careful" one, as
> described above and the one that is already in the spec right now with
> one caveat.
>
>
>
> The careful one replaces the one that is currently described in the spec
> and is thus performed with each removal operation.
>
>
>
> The one that we have right now is performed before a committer (or the
> receiver of a commit) applies a direct path, except that it can only
> remove nodes that are in the direct path of the committer.
>
>
>
> This should allow us to get the smallest tree that we can without
> compromising valid parent hash chains.
>
>
>
> Cheers,
>
> Konrad
>
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls
>

--00000000000031735b05d2cd3bc6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Konrad,<br><br>Thanks for thinking through this.=
=C2=A0 I mocked this up as a test case in mlspp, and I can confirm that it =
breaks there too.<br><br><a href=3D"https://github.com/cisco/mlspp/compare/=
truncate-parent?expand=3D1">https://github.com/cisco/mlspp/compare/truncate=
-parent?expand=3D1</a><br><br></div>A couple of thoughts here...<br><div><b=
r># Putting blanks in update paths<br><div><br></div><div>It occurs to me t=
hat there is a different solution approach available here,<br>which preserv=
es the sparsity of the tree, and even makes commits a little more<br>effici=
ent in some cases.</div><div><br></div>The starting point here is to observ=
e that the current update path algorithm<br>adds useless intermediate nodes=
.=C2=A0 The reason the parent hash fails in your<br>example is that G added=
 a useless intermediate node.=C2=A0 Since G is the only child<br>of 13, tha=
t node could just as well have been left blank.=C2=A0 The resolution<br>alg=
orithm would then result in the same number of encryptions when someone<br>=
elsewhere in the tree updated.<br><br>This is a small fix to the update pat=
h generation / processing algorithms.=C2=A0 When<br>the resolution of the c=
opath node is empty, you simply set the parent node to a<br>blank node inst=
ead of a populated parent node.<br><br>For the parent hash computation: Sin=
ce blank nodes are all the same for parent<br>hash, if the receiver of a tr=
ee knows where to put the blanks, then it can add<br>them into the parent h=
ash computation.=C2=A0 So the main work here would be to (1)<br>update the =
parent hash algorithm so that it can cover blank nodes, and (2) add<br>some=
 syntax to the ParentHash extension that describes where the blanks go.=C2=
=A0 If<br>we still had a notion of node indices, you could state it that wa=
y; less clear<br>how to do it otherwise.<br><br>To work through an example:=
 Suppose we have the following tree, in which G has<br>just sent a commit t=
o remove H.=C2=A0 The direct path sent by G resets nodes 12, 13,<br>11, 7, =
and 15, but sets node 13 to a blank because its copath resolution is<br>bla=
nk.<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 15<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_______________|<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0\<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A07 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______ =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A011 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0__|__ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 __|__ =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0|<br>=C2=A0 =
=C2=A01 =C2=A0 =C2=A0 =C2=A0 5 =C2=A0 =C2=A0 =C2=A0 9 =C2=A0 =C2=A0 =C2=A0 =
_ =C2=A0 =C2=A0 |<br>=C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =
=C2=A0 / \ =C2=A0 =C2=A0|<br>=C2=A0A =C2=A0 B =C2=A0 C =C2=A0 D =C2=A0 E =
=C2=A0 F =C2=A0 G =C2=A0 _ =C2=A0 I<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01 1 1 1 1 1 1<br>=C2=A00 1 2 3=
 4 5 6 7 8 9 0 1 2 3 4 5 6<br><br>The parent hash at G is thus over the pat=
h (12, _, 11, 7, 15).=C2=A0 We will assume<br>that G&#39;s parent hash exte=
nsion indicates that there is a blank in its direct<br>path between 12 and =
11.<br><br>Now suppose as in your example that A removes I, so that you end=
 up with the<br>same tree as in your example.<br><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__=
____|______<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A011<br>=C2=A0 =C2=A0 =C2=A0__|__ =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 __|<br>=C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 / =C2=A0 \<br>=C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 5 =C2=A0 =C2=A0 =
=C2=A0 9 =C2=A0 =C2=A0 |<br>=C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =
=C2=A0 =C2=A0|<br>=C2=A0A =C2=A0 B =C2=A0 C =C2=A0 D =C2=A0 E =C2=A0 F =C2=
=A0 G<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A01 1 1<br>=C2=A00 1 2 3 4 5 6 7 8 9 0 1 2<br><br>A recipient s=
eeing this tree can recognize that node 11 is covered by G&#39;s parent<br>=
hash, because it will add a virtual blank node when computing the parent ha=
sh<br>from 11 to G.<br><br>Now, that&#39;s pretty complicated, especially w=
hen you work out the details.=C2=A0 So<br>I&#39;m not sure it&#39;s the rig=
ht answer.=C2=A0 Just wanted to put it out there in the<br>interest of comp=
leteness.<br><br># Exponential delete<br><br>I don&#39;t think your propose=
d careful delete solution actually works.=C2=A0 You need<br>not only the pa=
rent node to be blank, but the whole path to the root.=C2=A0 I&#39;ll<br>as=
sert that without proof for now, because the counterexample requires an<br>=
inconveniently large tree :)<br><br>Fortunately, that idea turns into an al=
gorithm that&#39;s even simpler: Only<br>truncate the tree by removing the =
whole right side of it.=C2=A0 In the example above,<br>after I gets removed=
, you would keep the blank leaf at node 14, and move the<br>root of the tre=
e to node 7.=C2=A0 In an even sparser example:<br><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 15<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0_______________|<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\<br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0______|______ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0|<br>=C2=A0 =C2=A0 =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =
=C2=A0__|__ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __|__ =C2=A0 =C2=A0 =C2=A0 |=
<br>=C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =
=C2=A0 \ =C2=A0 =C2=A0 =C2=A0|<br>=C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 _ =C2=
=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 |<br>=C2=A0 / \ =
=C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0|<br>=C2=
=A0A =C2=A0 B =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 =
I<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A01 1 1 1 1 1 1<br>=C2=A00 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br><br>.=
.. after removing I you would first chop down to 0..14, then 0..6, then 0..=
2.<br>While root.right.empty(), root =3D root.left.<br><br>The overall sema=
ntic would then be that the tree grows linearly, but shrinks<br>exponential=
ly. =C2=A0(Like TCP!) =C2=A0That obviously keeps bigger trees around for<br=
>longer, but it ultimately gets the job done.=C2=A0 And an implementation t=
hat really<br>cares can use Remove+Add move operations to compact the tree.=
<br><br># ...<br><br>Overall, I think my preference here would be to go wit=
h the exponential delete<br>option. Adding blanks in the parent hash is nic=
e in that it saves some work, but<br>the details seem intimidatingly compli=
cated. Exponential delete is a simple,<br>easy-to-understand solution that =
still GC&#39;s the tree, just more slowly.<br><br>--Richard<br></div></div>=
<br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri=
, Dec 10, 2021 at 7:18 AM Konrad Kohbrok &lt;<a href=3D"mailto:konrad.kohbr=
ok@datashrine.de">konrad.kohbrok@datashrine.de</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
<br>
<br>
while testing changes to our tree implementation, we found what we <br>
believe is a bug in the specification. More concretely, the tree <br>
truncation mandated by the spec is too aggressive and can destroy parent <b=
r>
hashes in an otherwise valid tree.<br>
<br>
<br>
<br>
For debugging purposes, we had a check that would validate parent hashes <b=
r>
of every node every time a commit is processed, which is how we found <br>
the bug.<br>
<br>
<br>
<br>
Currently, the spec mandates that upon a remove operation, the leaves <br>
are removed until the right-most leaf in non-blank. However, this can <br>
lead to a situation, where non-blank parent nodes of a non-blank leaf <br>
are removed. This removal potentially interrupts valid <br>
&quot;parent-hash-chains&quot;. More concretely, if the affected leaf node =
was the <br>
last node to commit a path in its subtree, then overly aggressive <br>
truncation can lead to the removal of parent nodes in that path. This in <b=
r>
turn leads to an error when the parent hash of the parent of the removed <b=
r>
parent node is verified. Note that if the parent hash chain is <br>
interrupted in this way, the situation is indistinguishable from one <br>
where the parent hash of a node is simply invalid.<br>
<br>
<br>
<br>
Consider the following example:<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A015<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_____________=
__|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A03=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 11=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0__|__=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__|__=C2=
=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/=C2=
=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 =C2=A0 =C2=A0 =C2=A09=C2=
=A0 =C2=A0 =C2=A0 13=C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 / \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=
=A0/ \=C2=A0 =C2=A0 |<br>
<br>
A=C2=A0 =C2=A0B=C2=A0 =C2=A0C=C2=A0 =C2=A0D=C2=A0 =C2=A0E=C2=A0 =C2=A0F=C2=
=A0 =C2=A0G=C2=A0 =C2=A0-=C2=A0 =C2=A0I<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A01 1 1 1 1 1 1<br>
<br>
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br>
<br>
<br>
<br>
- G performs an update, leading to a valid parent hash chain along its <br>
direct path (13, 11, 7, 15).<br>
<br>
- A removes I, leading to the following state, since G is the right-most <b=
r>
non-blank leaf.<br>
<br>
<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0\<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A03=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 11<br>
<br>
=C2=A0 =C2=A0 =C2=A0__|__=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__|<br>
<br>
=C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/=C2=
=A0 =C2=A0\<br>
<br>
=C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 =C2=A0 =C2=A0 =C2=A09=C2=
=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 / \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 |<br>
<br>
A=C2=A0 =C2=A0B=C2=A0 =C2=A0C=C2=A0 =C2=A0D=C2=A0 =C2=A0E=C2=A0 =C2=A0F=C2=
=A0 =C2=A0G<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A01 1 1<br>
<br>
0 1 2 3 4 5 6 7 8 9 0 1 2<br>
<br>
<br>
<br>
- Since we have removed 13 in the process of removing (leaf) node 14, <br>
verification of the parent hash of node 11 will now fail, since none of <br=
>
its children carries its hash in its parent hash field.<br>
<br>
- This will become apparent if a new member is added, either by one of <br>
the nodes A-D or by any node without a path.<br>
<br>
<br>
<br>
As solution, we propose that the right-most leaf is only removed in the <br=
>
process of truncation if both it _and its parent_ are blank.<br>
<br>
<br>
<br>
<br>
<br>
Raphael pointed out that this &quot;careful&quot; truncation leads to spars=
er <br>
trees and thus makes the protocol overall less efficient (larger tree <br>
structures need to be stored, longer direct paths with more secrets and <br=
>
key pairs to derive, etc.).<br>
<br>
<br>
<br>
We can fix this by having two forms of truncation: A &quot;careful&quot; on=
e, as <br>
described above and the one that is already in the spec right now with <br>
one caveat.<br>
<br>
<br>
<br>
The careful one replaces the one that is currently described in the spec <b=
r>
and is thus performed with each removal operation.<br>
<br>
<br>
<br>
The one that we have right now is performed before a committer (or the <br>
receiver of a commit) applies a direct path, except that it can only <br>
remove nodes that are in the direct path of the committer.<br>
<br>
<br>
<br>
This should allow us to get the smallest tree that we can without <br>
compromising valid parent hash chains.<br>
<br>
<br>
<br>
Cheers,<br>
<br>
Konrad<br>
<br>
_______________________________________________<br>
MLS mailing list<br>
<a href=3D"mailto:MLS@ietf.org" target=3D"_blank">MLS@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/mls" rel=3D"noreferrer" ta=
rget=3D"_blank">https://www.ietf.org/mailman/listinfo/mls</a><br>
</blockquote></div>

--00000000000031735b05d2cd3bc6--


From nobody Fri Dec 10 09:55:32 2021
Return-Path: <ietf@raphaelrobert.com>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C76FC3A0A1B for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 09:55:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level: 
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=raphaelrobert.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LvVvDWu-9yEF for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 09:55:25 -0800 (PST)
Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 171663A0A17 for <mls@ietf.org>; Fri, 10 Dec 2021 09:55:24 -0800 (PST)
Received: by mail-wr1-x429.google.com with SMTP id q3so16229228wru.5 for <mls@ietf.org>; Fri, 10 Dec 2021 09:55:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raphaelrobert.com; s=rr; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=hvxiqrP79BU+gnEwyfZdP4Qip1g/JKy3A/BA2TVsDLk=; b=GhCyen5gUjN2kiLZcfRZRasb7Pvc8dSMtAeAj6HScuNFWA1qdfsgA7K8onITu/XU4x ll6LqN/ngFJsVE5iQJbep9ecYJvyMntE6U9APPH9Bigh7zA1oe/vtS83AwpxCMq1C6W5 mIx8Ccd3LQQVGF5zWuFgxrlXSNi+Pz0Rw+bv8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=hvxiqrP79BU+gnEwyfZdP4Qip1g/JKy3A/BA2TVsDLk=; b=iGautC9pfCfgpATBcJRzkgt3yMcRtJJvj4Hx8h2JxAtTjhoPxkVqzDsqlEdDPrh6hi 18FuGsuxQF+G6mjVhY9pb9zINw7/NRR/rBpn8vnwnSTaTHCxVKOFFFRsk8gh5H0mEy8j 2MGxE8s5Oi8V8/QyIXQNT56Ty9R99IBRKJWo8J658BUHHYQDxyKCXGweQsN2RoB9afkb 5Y8YgDsEFeB1nUBfGOvhlMareFw9mmB2lE2kuj7MjDmj5Xle9SoMOXSdeQOiZ1CTHC7z b3rgM2MzjMBbapib/qJptU8lZG00erOlILoraHA9zyZk9dRHgXIpBjbBYkVdkj/I1XXY 7leg==
X-Gm-Message-State: AOAM530S3dJdUNPJUFbnn4ZN2ztiJKQaMnyWz6S83LI5pBu3j0jYN6eJ aZAdwBkdUQ1kniFmq8TChzFZEQ==
X-Google-Smtp-Source: ABdhPJw2y+q+5PXUo4r9QHT9XtaN2A/GLCV72zv2sQcA7wApLIa/B9JYWEv66GRfakIuXtfJWQrOSQ==
X-Received: by 2002:a5d:570b:: with SMTP id a11mr15613571wrv.600.1639158920898;  Fri, 10 Dec 2021 09:55:20 -0800 (PST)
Received: from smtpclient.apple (HSI-KBW-095-208-241-080.hsi5.kabel-badenwuerttemberg.de. [95.208.241.80]) by smtp.gmail.com with ESMTPSA id v6sm128720wrm.115.2021.12.10.09.55.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Dec 2021 09:55:20 -0800 (PST)
From: Raphael Robert <ietf@raphaelrobert.com>
Message-Id: <D7947582-3982-45E6-89E7-529B24F62F9C@raphaelrobert.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_68562323-165C-4F47-90E0-0F9BDD73366F"
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\))
Date: Fri, 10 Dec 2021 18:55:19 +0100
In-Reply-To: <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com>
Cc: Konrad Kohbrok <konrad.kohbrok@datashrine.de>, mls@ietf.org
To: Richard Barnes <rlb@ipv.sx>
References: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de> <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com>
X-Mailer: Apple Mail (2.3693.20.0.1.32)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/oEweOe-U34wHfb8ysy2q9Cg08M8>
Subject: Re: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Dec 2021 17:55:31 -0000

--Apple-Mail=_68562323-165C-4F47-90E0-0F9BDD73366F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Thanks for verifying it Richard!

Since things get confusing quickly given the complexity of the subject, =
I want to summarise the different mechanisms discussed so far:

M1: Trimming carefully upon removing members
I think we essentially talk about the same thing here (what you call =
exponential delete). It can be expressed quite simply in the array =
representation. We inspect the rightmost tuple of nodes (parent_node, =
leaf_node) in the array. Previously =E2=80=93 with the aggressive =
trimming =E2=80=93 we would remove the tuple if leaf_node was blank. =
What we propose is to only remove the tuple when both parent_node and =
leaf_node are blank.

M2: Trim the direct path of committers by omitting blank nodes
This is what you proposed in your previous email. I agree that it sounds =
quite involved at first and could have some unforeseen effects =
elsewhere. This approach however seems to have the highest gain of =
efficiency, because unnecessary parent nodes are removed even before the =
original trimming would occur.

M3: Trim the tree before computing the update path of a commit
This what Konrad additionally described in his email. In essence, =
another trimming pass starting from the right side of the tree takes =
place before the committer computes the update path. The effect is =
similar to M2, but it occurs later in time (namely only once the leaves =
rough to the committer have been removed). This approach does not =
require to have blanks in the direct path, it just potentially shortens =
the direct path (and therefore the update path). The complexity seems =
moderate and so far I don=E2=80=99t this could have nasty side effects.

Now, the question is which on of those we would like to mandate in the =
spec. It seems we agree that M1 is uncontroversial as such, we just need =
to agree on the details of the algorithm.
M2 and M3 are mutually exclusive, in that M3 becomes unnecessary if we =
also have M2.

Assuming we don=E2=80=99t come up with more mechanisms, I currently see =
3 approaches:

M1 + M2: Highest efficiency, but also highest complexity
M1 + M3: Balance between efficiency and complexity
M1: Conservative choice, slowest shrinking of trees

My take on it is that we should go with M1 for now because it seems to =
be orthogonal to M2/M3 anyway. We can still ponder a bit more about =
M2/M3 in the meantime.

Raphael


> On 10. Dec 2021, at 17:29, Richard Barnes <rlb@ipv.sx> wrote:
>=20
> Hi Konrad,
>=20
> Thanks for thinking through this.  I mocked this up as a test case in =
mlspp, and I can confirm that it breaks there too.
>=20
> https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D1 =
<https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D1>
>=20
> A couple of thoughts here...
>=20
> # Putting blanks in update paths
>=20
> It occurs to me that there is a different solution approach available =
here,
> which preserves the sparsity of the tree, and even makes commits a =
little more
> efficient in some cases.
>=20
> The starting point here is to observe that the current update path =
algorithm
> adds useless intermediate nodes.  The reason the parent hash fails in =
your
> example is that G added a useless intermediate node.  Since G is the =
only child
> of 13, that node could just as well have been left blank.  The =
resolution
> algorithm would then result in the same number of encryptions when =
someone
> elsewhere in the tree updated.
>=20
> This is a small fix to the update path generation / processing =
algorithms.  When
> the resolution of the copath node is empty, you simply set the parent =
node to a
> blank node instead of a populated parent node.
>=20
> For the parent hash computation: Since blank nodes are all the same =
for parent
> hash, if the receiver of a tree knows where to put the blanks, then it =
can add
> them into the parent hash computation.  So the main work here would be =
to (1)
> update the parent hash algorithm so that it can cover blank nodes, and =
(2) add
> some syntax to the ParentHash extension that describes where the =
blanks go.  If
> we still had a notion of node indices, you could state it that way; =
less clear
> how to do it otherwise.
>=20
> To work through an example: Suppose we have the following tree, in =
which G has
> just sent a commit to remove H.  The direct path sent by G resets =
nodes 12, 13,
> 11, 7, and 15, but sets node 13 to a blank because its copath =
resolution is
> blank.
>=20
>                                 15
>                  _______________|
>                 /                \
>                7                 |
>          ______|______           |
>         /             \          |
>        3              11         |
>      __|__           __|__       |
>     /     \         /     \      |
>    1       5       9       _     |
>   / \     / \     / \     / \    |
>  A   B   C   D   E   F   G   _   I
>=20
>                      1 1 1 1 1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>=20
> The parent hash at G is thus over the path (12, _, 11, 7, 15).  We =
will assume
> that G's parent hash extension indicates that there is a blank in its =
direct
> path between 12 and 11.
>=20
> Now suppose as in your example that A removes I, so that you end up =
with the
> same tree as in your example.
>=20
>                7
>          ______|______
>         /             \
>        3              11
>      __|__           __|
>     /     \         /   \
>    1       5       9     |
>   / \     / \     / \    |
>  A   B   C   D   E   F   G
>=20
>                      1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2
>=20
> A recipient seeing this tree can recognize that node 11 is covered by =
G's parent
> hash, because it will add a virtual blank node when computing the =
parent hash
> from 11 to G.
>=20
> Now, that's pretty complicated, especially when you work out the =
details.  So
> I'm not sure it's the right answer.  Just wanted to put it out there =
in the
> interest of completeness.
>=20
> # Exponential delete
>=20
> I don't think your proposed careful delete solution actually works.  =
You need
> not only the parent node to be blank, but the whole path to the root.  =
I'll
> assert that without proof for now, because the counterexample requires =
an
> inconveniently large tree :)
>=20
> Fortunately, that idea turns into an algorithm that's even simpler: =
Only
> truncate the tree by removing the whole right side of it.  In the =
example above,
> after I gets removed, you would keep the blank leaf at node 14, and =
move the
> root of the tree to node 7.  In an even sparser example:
>=20
>                                 15
>                  _______________|
>                 /                \
>                7                 |
>          ______|______           |
>         /             \          |
>        3               _         |
>      __|__           __|__       |
>     /     \         /     \      |
>    1       _       _       _     |
>   / \     / \     / \     / \    |
>  A   B   _   _   _   _   _   _   I
>=20
>                      1 1 1 1 1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>=20
> ... after removing I you would first chop down to 0..14, then 0..6, =
then 0..2.
> While root.right.empty(), root =3D root.left.
>=20
> The overall semantic would then be that the tree grows linearly, but =
shrinks
> exponentially.  (Like TCP!)  That obviously keeps bigger trees around =
for
> longer, but it ultimately gets the job done.  And an implementation =
that really
> cares can use Remove+Add move operations to compact the tree.
>=20
> # ...
>=20
> Overall, I think my preference here would be to go with the =
exponential delete
> option. Adding blanks in the parent hash is nice in that it saves some =
work, but
> the details seem intimidatingly complicated. Exponential delete is a =
simple,
> easy-to-understand solution that still GC's the tree, just more =
slowly.
>=20
> --Richard
>=20
> On Fri, Dec 10, 2021 at 7:18 AM Konrad Kohbrok =
<konrad.kohbrok@datashrine.de <mailto:konrad.kohbrok@datashrine.de>> =
wrote:
> Hi everyone,
>=20
>=20
>=20
> while testing changes to our tree implementation, we found what we=20
> believe is a bug in the specification. More concretely, the tree=20
> truncation mandated by the spec is too aggressive and can destroy =
parent=20
> hashes in an otherwise valid tree.
>=20
>=20
>=20
> For debugging purposes, we had a check that would validate parent =
hashes=20
> of every node every time a commit is processed, which is how we found=20=

> the bug.
>=20
>=20
>=20
> Currently, the spec mandates that upon a remove operation, the leaves=20=

> are removed until the right-most leaf in non-blank. However, this can=20=

> lead to a situation, where non-blank parent nodes of a non-blank leaf=20=

> are removed. This removal potentially interrupts valid=20
> "parent-hash-chains". More concretely, if the affected leaf node was =
the=20
> last node to commit a path in its subtree, then overly aggressive=20
> truncation can lead to the removal of parent nodes in that path. This =
in=20
> turn leads to an error when the parent hash of the parent of the =
removed=20
> parent node is verified. Note that if the parent hash chain is=20
> interrupted in this way, the situation is indistinguishable from one=20=

> where the parent hash of a node is simply invalid.
>=20
>=20
>=20
> Consider the following example:
>=20
>=20
>=20
>                                15
>=20
>                  _______________|
>=20
>                 /                |
>=20
>                7                 |
>=20
>          ______|______           |
>=20
>         /             \          |
>=20
>        3              11         |
>=20
>      __|__           __|__       |
>=20
>     /     \         /     \      |
>=20
>    1       5       9      13     |
>=20
>   / \     / \     / \     / \    |
>=20
> A   B   C   D   E   F   G   -   I
>=20
>=20
>=20
>                      1 1 1 1 1 1 1
>=20
> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>=20
>=20
>=20
> - G performs an update, leading to a valid parent hash chain along its=20=

> direct path (13, 11, 7, 15).
>=20
> - A removes I, leading to the following state, since G is the =
right-most=20
> non-blank leaf.
>=20
>=20
>=20
>=20
>=20
>                7
>=20
>          ______|______
>=20
>         /             \
>=20
>        3              11
>=20
>      __|__           __|
>=20
>     /     \         /   \
>=20
>    1       5       9     |
>=20
>   / \     / \     / \    |
>=20
> A   B   C   D   E   F   G
>=20
>=20
>=20
>                      1 1 1
>=20
> 0 1 2 3 4 5 6 7 8 9 0 1 2
>=20
>=20
>=20
> - Since we have removed 13 in the process of removing (leaf) node 14,=20=

> verification of the parent hash of node 11 will now fail, since none =
of=20
> its children carries its hash in its parent hash field.
>=20
> - This will become apparent if a new member is added, either by one of=20=

> the nodes A-D or by any node without a path.
>=20
>=20
>=20
> As solution, we propose that the right-most leaf is only removed in =
the=20
> process of truncation if both it _and its parent_ are blank.
>=20
>=20
>=20
>=20
>=20
> Raphael pointed out that this "careful" truncation leads to sparser=20
> trees and thus makes the protocol overall less efficient (larger tree=20=

> structures need to be stored, longer direct paths with more secrets =
and=20
> key pairs to derive, etc.).
>=20
>=20
>=20
> We can fix this by having two forms of truncation: A "careful" one, as=20=

> described above and the one that is already in the spec right now with=20=

> one caveat.
>=20
>=20
>=20
> The careful one replaces the one that is currently described in the =
spec=20
> and is thus performed with each removal operation.
>=20
>=20
>=20
> The one that we have right now is performed before a committer (or the=20=

> receiver of a commit) applies a direct path, except that it can only=20=

> remove nodes that are in the direct path of the committer.
>=20
>=20
>=20
> This should allow us to get the smallest tree that we can without=20
> compromising valid parent hash chains.
>=20
>=20
>=20
> Cheers,
>=20
> Konrad
>=20
> _______________________________________________
> MLS mailing list
> MLS@ietf.org <mailto:MLS@ietf.org>
> https://www.ietf.org/mailman/listinfo/mls =
<https://www.ietf.org/mailman/listinfo/mls>
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls


--Apple-Mail=_68562323-165C-4F47-90E0-0F9BDD73366F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D"">Thanks for verifying it Richard!<div class=3D""><br =
class=3D""></div><div class=3D"">Since things get confusing quickly =
given the complexity of the subject, I want to summarise the different =
mechanisms discussed so far:</div><div class=3D""><br =
class=3D""></div><div class=3D"">M1: Trimming carefully upon removing =
members</div><div class=3D"">I think we essentially talk about the same =
thing here (what you call exponential delete). It can be expressed quite =
simply in the array representation. We inspect the rightmost tuple of =
nodes (parent_node, leaf_node) in the array. Previously =E2=80=93 with =
the aggressive trimming =E2=80=93 we would remove the tuple if leaf_node =
was blank. What we propose is to only remove the tuple when both =
parent_node and leaf_node are blank.</div><div class=3D""><br =
class=3D""></div><div class=3D"">M2: Trim the direct path of committers =
by omitting blank nodes</div><div class=3D"">This is what you proposed =
in your previous email. I agree that it sounds quite involved at first =
and could have some unforeseen effects elsewhere. This approach however =
seems to have the highest gain of efficiency, because unnecessary parent =
nodes are removed even before the original trimming would =
occur.</div><div class=3D""><br class=3D""></div><div class=3D"">M3: =
Trim the tree before computing the update path of a commit</div><div =
class=3D"">This what Konrad additionally described in his email. In =
essence, another trimming pass starting from the right side of the tree =
takes place before the committer computes the update path. The effect is =
similar to M2, but it occurs later in time (namely only once the leaves =
rough to the committer have been removed). This approach does not =
require to have blanks in the direct path, it just potentially shortens =
the direct path (and therefore the update path). The complexity seems =
moderate and so far I don=E2=80=99t this could have nasty side =
effects.</div><div class=3D""><br class=3D""></div><div class=3D"">Now, =
the question is which on of those we would like to mandate in the spec. =
It seems we agree that M1 is uncontroversial as such, we just need to =
agree on the details of the algorithm.</div><div class=3D"">M2 and M3 =
are mutually exclusive, in that M3 becomes unnecessary if we also have =
M2.</div><div class=3D""><br class=3D""></div><div class=3D"">Assuming =
we don=E2=80=99t come up with more mechanisms, I currently see 3 =
approaches:</div><div class=3D""><br class=3D""></div><div class=3D"">M1 =
+ M2: Highest efficiency, but also highest complexity</div><div =
class=3D"">M1 + M3: Balance between efficiency and complexity</div><div =
class=3D"">M1: Conservative choice, slowest shrinking of trees</div><div =
class=3D""><br class=3D""></div><div class=3D"">My take on it is that we =
should go with M1 for now because it seems to be orthogonal to M2/M3 =
anyway. We can still ponder a bit more about M2/M3 in the =
meantime.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Raphael</div><div class=3D""><br class=3D""></div><div =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 10. Dec 2021, at 17:29, Richard Barnes &lt;<a =
href=3D"mailto:rlb@ipv.sx" class=3D"">rlb@ipv.sx</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr" =
class=3D""><div class=3D"">Hi Konrad,<br class=3D""><br class=3D"">Thanks =
for thinking through this.&nbsp; I mocked this up as a test case in =
mlspp, and I can confirm that it breaks there too.<br class=3D""><br =
class=3D""><a =
href=3D"https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D1"=
 =
class=3D"">https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D=
1</a><br class=3D""><br class=3D""></div>A couple of thoughts here...<br =
class=3D""><div class=3D""><br class=3D""># Putting blanks in update =
paths<br class=3D""><div class=3D""><br class=3D""></div><div =
class=3D"">It occurs to me that there is a different solution approach =
available here,<br class=3D"">which preserves the sparsity of the tree, =
and even makes commits a little more<br class=3D"">efficient in some =
cases.</div><div class=3D""><br class=3D""></div>The starting point here =
is to observe that the current update path algorithm<br class=3D"">adds =
useless intermediate nodes.&nbsp; The reason the parent hash fails in =
your<br class=3D"">example is that G added a useless intermediate =
node.&nbsp; Since G is the only child<br class=3D"">of 13, that node =
could just as well have been left blank.&nbsp; The resolution<br =
class=3D"">algorithm would then result in the same number of encryptions =
when someone<br class=3D"">elsewhere in the tree updated.<br =
class=3D""><br class=3D"">This is a small fix to the update path =
generation / processing algorithms.&nbsp; When<br class=3D"">the =
resolution of the copath node is empty, you simply set the parent node =
to a<br class=3D"">blank node instead of a populated parent node.<br =
class=3D""><br class=3D"">For the parent hash computation: Since blank =
nodes are all the same for parent<br class=3D"">hash, if the receiver of =
a tree knows where to put the blanks, then it can add<br class=3D"">them =
into the parent hash computation.&nbsp; So the main work here would be =
to (1)<br class=3D"">update the parent hash algorithm so that it can =
cover blank nodes, and (2) add<br class=3D"">some syntax to the =
ParentHash extension that describes where the blanks go.&nbsp; If<br =
class=3D"">we still had a notion of node indices, you could state it =
that way; less clear<br class=3D"">how to do it otherwise.<br =
class=3D""><br class=3D"">To work through an example: Suppose we have =
the following tree, in which G has<br class=3D"">just sent a commit to =
remove H.&nbsp; The direct path sent by G resets nodes 12, 13,<br =
class=3D"">11, 7, and 15, but sets node 13 to a blank because its copath =
resolution is<br class=3D"">blank.<br class=3D""><br class=3D"">&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15<br class=3D"">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_______________|<br =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\<br =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;______|______ &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; |<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; / =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;|<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;11 &nbsp; &nbsp; &nbsp; &nbsp; |<br =
class=3D"">&nbsp; &nbsp; &nbsp;__|__ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
__|__ &nbsp; &nbsp; &nbsp; |<br class=3D"">&nbsp; &nbsp; / &nbsp; &nbsp; =
\ &nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp;|<br =
class=3D"">&nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; 9 =
&nbsp; &nbsp; &nbsp; _ &nbsp; &nbsp; |<br class=3D"">&nbsp; / \ &nbsp; =
&nbsp; / \ &nbsp; &nbsp; / \ &nbsp; &nbsp; / \ &nbsp; &nbsp;|<br =
class=3D"">&nbsp;A &nbsp; B &nbsp; C &nbsp; D &nbsp; E &nbsp; F &nbsp; G =
&nbsp; _ &nbsp; I<br class=3D""><br class=3D"">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 1 1 1 1 1 1<br =
class=3D"">&nbsp;0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br class=3D""><br =
class=3D"">The parent hash at G is thus over the path (12, _, 11, 7, =
15).&nbsp; We will assume<br class=3D"">that G's parent hash extension =
indicates that there is a blank in its direct<br class=3D"">path between =
12 and 11.<br class=3D""><br class=3D"">Now suppose as in your example =
that A removes I, so that you end up with the<br class=3D"">same tree as =
in your example.<br class=3D""><br class=3D"">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7<br class=3D"">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;______|______<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; / =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<br class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;11<br =
class=3D"">&nbsp; &nbsp; &nbsp;__|__ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
__|<br class=3D"">&nbsp; &nbsp; / &nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp; =
&nbsp; / &nbsp; \<br class=3D"">&nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; 5 =
&nbsp; &nbsp; &nbsp; 9 &nbsp; &nbsp; |<br class=3D"">&nbsp; / \ &nbsp; =
&nbsp; / \ &nbsp; &nbsp; / \ &nbsp; &nbsp;|<br class=3D"">&nbsp;A &nbsp; =
B &nbsp; C &nbsp; D &nbsp; E &nbsp; F &nbsp; G<br class=3D""><br =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;1 1 1<br class=3D"">&nbsp;0 1 2 3 4 5 6 7 8 9 0 1 =
2<br class=3D""><br class=3D"">A recipient seeing this tree can =
recognize that node 11 is covered by G's parent<br class=3D"">hash, =
because it will add a virtual blank node when computing the parent =
hash<br class=3D"">from 11 to G.<br class=3D""><br class=3D"">Now, =
that's pretty complicated, especially when you work out the =
details.&nbsp; So<br class=3D"">I'm not sure it's the right =
answer.&nbsp; Just wanted to put it out there in the<br =
class=3D"">interest of completeness.<br class=3D""><br class=3D""># =
Exponential delete<br class=3D""><br class=3D"">I don't think your =
proposed careful delete solution actually works.&nbsp; You need<br =
class=3D"">not only the parent node to be blank, but the whole path to =
the root.&nbsp; I'll<br class=3D"">assert that without proof for now, =
because the counterexample requires an<br class=3D"">inconveniently =
large tree :)<br class=3D""><br class=3D"">Fortunately, that idea turns =
into an algorithm that's even simpler: Only<br class=3D"">truncate the =
tree by removing the whole right side of it.&nbsp; In the example =
above,<br class=3D"">after I gets removed, you would keep the blank leaf =
at node 14, and move the<br class=3D"">root of the tree to node 7.&nbsp; =
In an even sparser example:<br class=3D""><br class=3D"">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; 15<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_______________|<br class=3D"">&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\<br class=3D"">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; |<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;______|______ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br =
class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br class=3D"">&nbsp; =
&nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _ =
&nbsp; &nbsp; &nbsp; &nbsp; |<br class=3D"">&nbsp; &nbsp; &nbsp;__|__ =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __|__ &nbsp; &nbsp; &nbsp; |<br =
class=3D"">&nbsp; &nbsp; / &nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp; &nbsp; / =
&nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp;|<br class=3D"">&nbsp; &nbsp;1 =
&nbsp; &nbsp; &nbsp; _ &nbsp; &nbsp; &nbsp; _ &nbsp; &nbsp; &nbsp; _ =
&nbsp; &nbsp; |<br class=3D"">&nbsp; / \ &nbsp; &nbsp; / \ &nbsp; &nbsp; =
/ \ &nbsp; &nbsp; / \ &nbsp; &nbsp;|<br class=3D"">&nbsp;A &nbsp; B =
&nbsp; _ &nbsp; _ &nbsp; _ &nbsp; _ &nbsp; _ &nbsp; _ &nbsp; I<br =
class=3D""><br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 1 1 1 1 1 1<br class=3D"">&nbsp;0 1 =
2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br class=3D""><br class=3D"">... after =
removing I you would first chop down to 0..14, then 0..6, then 0..2.<br =
class=3D"">While root.right.empty(), root =3D root.left.<br class=3D""><br=
 class=3D"">The overall semantic would then be that the tree grows =
linearly, but shrinks<br class=3D"">exponentially. &nbsp;(Like TCP!) =
&nbsp;That obviously keeps bigger trees around for<br class=3D"">longer, =
but it ultimately gets the job done.&nbsp; And an implementation that =
really<br class=3D"">cares can use Remove+Add move operations to compact =
the tree.<br class=3D""><br class=3D""># ...<br class=3D""><br =
class=3D"">Overall, I think my preference here would be to go with the =
exponential delete<br class=3D"">option. Adding blanks in the parent =
hash is nice in that it saves some work, but<br class=3D"">the details =
seem intimidatingly complicated. Exponential delete is a simple,<br =
class=3D"">easy-to-understand solution that still GC's the tree, just =
more slowly.<br class=3D""><br class=3D"">--Richard<br =
class=3D""></div></div><br class=3D""><div class=3D"gmail_quote"><div =
dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 10, 2021 at 7:18 AM Konrad =
Kohbrok &lt;<a href=3D"mailto:konrad.kohbrok@datashrine.de" =
class=3D"">konrad.kohbrok@datashrine.de</a>&gt; wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex">Hi everyone,<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
while testing changes to our tree implementation, we found what we <br =
class=3D"">
believe is a bug in the specification. More concretely, the tree <br =
class=3D"">
truncation mandated by the spec is too aggressive and can destroy parent =
<br class=3D"">
hashes in an otherwise valid tree.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
For debugging purposes, we had a check that would validate parent hashes =
<br class=3D"">
of every node every time a commit is processed, which is how we found =
<br class=3D"">
the bug.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
Currently, the spec mandates that upon a remove operation, the leaves =
<br class=3D"">
are removed until the right-most leaf in non-blank. However, this can =
<br class=3D"">
lead to a situation, where non-blank parent nodes of a non-blank leaf =
<br class=3D"">
are removed. This removal potentially interrupts valid <br class=3D"">
"parent-hash-chains". More concretely, if the affected leaf node was the =
<br class=3D"">
last node to commit a path in its subtree, then overly aggressive <br =
class=3D"">
truncation can lead to the removal of parent nodes in that path. This in =
<br class=3D"">
turn leads to an error when the parent hash of the parent of the removed =
<br class=3D"">
parent node is verified. Note that if the parent hash chain is <br =
class=3D"">
interrupted in this way, the situation is indistinguishable from one <br =
class=3D"">
where the parent hash of a node is simply invalid.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
Consider the following example:<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;15<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;_______________|<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;______|______&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;\&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp;3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; 11&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp;__|__&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;__|__&nbsp; &nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; /&nbsp; &nbsp; &nbsp;\&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;/&nbsp; &nbsp; &nbsp;\&nbsp; &nbsp; &nbsp; |<br class=3D"">
<br class=3D"">
&nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp;5&nbsp; &nbsp; &nbsp; =
&nbsp;9&nbsp; &nbsp; &nbsp; 13&nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; / \&nbsp; &nbsp; &nbsp;/ \&nbsp; &nbsp; &nbsp;/ \&nbsp; &nbsp; =
&nbsp;/ \&nbsp; &nbsp; |<br class=3D"">
<br class=3D"">
A&nbsp; &nbsp;B&nbsp; &nbsp;C&nbsp; &nbsp;D&nbsp; &nbsp;E&nbsp; =
&nbsp;F&nbsp; &nbsp;G&nbsp; &nbsp;-&nbsp; &nbsp;I<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;1 1 1 1 1 1 1<br class=3D"">
<br class=3D"">
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
- G performs an update, leading to a valid parent hash chain along its =
<br class=3D"">
direct path (13, 11, 7, 15).<br class=3D"">
<br class=3D"">
- A removes I, leading to the following state, since G is the right-most =
<br class=3D"">
non-blank leaf.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;______|______<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;\<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp;3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; 11<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp;__|__&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__|<br =
class=3D"">
<br class=3D"">
&nbsp; &nbsp; /&nbsp; &nbsp; &nbsp;\&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;/&nbsp; &nbsp;\<br class=3D"">
<br class=3D"">
&nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp;5&nbsp; &nbsp; &nbsp; =
&nbsp;9&nbsp; &nbsp; &nbsp;|<br class=3D"">
<br class=3D"">
&nbsp; / \&nbsp; &nbsp; &nbsp;/ \&nbsp; &nbsp; &nbsp;/ \&nbsp; &nbsp; =
|<br class=3D"">
<br class=3D"">
A&nbsp; &nbsp;B&nbsp; &nbsp;C&nbsp; &nbsp;D&nbsp; &nbsp;E&nbsp; =
&nbsp;F&nbsp; &nbsp;G<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;1 1 1<br class=3D"">
<br class=3D"">
0 1 2 3 4 5 6 7 8 9 0 1 2<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
- Since we have removed 13 in the process of removing (leaf) node 14, =
<br class=3D"">
verification of the parent hash of node 11 will now fail, since none of =
<br class=3D"">
its children carries its hash in its parent hash field.<br class=3D"">
<br class=3D"">
- This will become apparent if a new member is added, either by one of =
<br class=3D"">
the nodes A-D or by any node without a path.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
As solution, we propose that the right-most leaf is only removed in the =
<br class=3D"">
process of truncation if both it _and its parent_ are blank.<br =
class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
Raphael pointed out that this "careful" truncation leads to sparser <br =
class=3D"">
trees and thus makes the protocol overall less efficient (larger tree =
<br class=3D"">
structures need to be stored, longer direct paths with more secrets and =
<br class=3D"">
key pairs to derive, etc.).<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
We can fix this by having two forms of truncation: A "careful" one, as =
<br class=3D"">
described above and the one that is already in the spec right now with =
<br class=3D"">
one caveat.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
The careful one replaces the one that is currently described in the spec =
<br class=3D"">
and is thus performed with each removal operation.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
The one that we have right now is performed before a committer (or the =
<br class=3D"">
receiver of a commit) applies a direct path, except that it can only <br =
class=3D"">
remove nodes that are in the direct path of the committer.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
This should allow us to get the smallest tree that we can without <br =
class=3D"">
compromising valid parent hash chains.<br class=3D"">
<br class=3D"">
<br class=3D"">
<br class=3D"">
Cheers,<br class=3D"">
<br class=3D"">
Konrad<br class=3D"">
<br class=3D"">
_______________________________________________<br class=3D"">
MLS mailing list<br class=3D"">
<a href=3D"mailto:MLS@ietf.org" target=3D"_blank" =
class=3D"">MLS@ietf.org</a><br class=3D"">
<a href=3D"https://www.ietf.org/mailman/listinfo/mls" rel=3D"noreferrer" =
target=3D"_blank" =
class=3D"">https://www.ietf.org/mailman/listinfo/mls</a><br class=3D"">
</blockquote></div>
_______________________________________________<br class=3D"">MLS =
mailing list<br class=3D""><a href=3D"mailto:MLS@ietf.org" =
class=3D"">MLS@ietf.org</a><br =
class=3D"">https://www.ietf.org/mailman/listinfo/mls<br =
class=3D""></div></blockquote></div><br class=3D""></div></body></html>=

--Apple-Mail=_68562323-165C-4F47-90E0-0F9BDD73366F--


From nobody Fri Dec 10 10:15:16 2021
Return-Path: <konrad.kohbrok@datashrine.de>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6186F3A0A4C for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 10:15:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level: 
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=datashrine.de
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hlg0b4852clL for <mls@ietfa.amsl.com>; Fri, 10 Dec 2021 10:15:10 -0800 (PST)
Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B3C333A0A47 for <mls@ietf.org>; Fri, 10 Dec 2021 10:15:08 -0800 (PST)
Received: from smtp202.mailbox.org (smtp202.mailbox.org [80.241.60.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4J9fFj0N5mzQjXy for <mls@ietf.org>; Fri, 10 Dec 2021 19:15:05 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datashrine.de; s=MBO0001; t=1639160102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o/p8e9U98IaQtKvp3TsIK7Pn+AX6au3Tul0Qld6QNkc=; b=yLxW/Jm3kwm6d0NYx1QMuVuY67KDrFY8fPSotvHHN/fxf7r5VmJK/gdnvjNNs9sUTJbMrQ YcdUpXr2JpvQArZbybOY0FTUp2WcadsFit3bZxlzLCT7oF41+zSqE992xN64aXxhOIJjt6 XIdGWL3f3xBwBEKQ4rR9+HXoCgkJF4Xaoh/fS9oxvmuGpBMxiO9MR8AK0Y4VjPR9p2146U I7s4fVRstUS/+CeDvqboeIzgnwslTNmBqHAHmgk/lYnYLV3Hco76ldHL0vIIkoW5M959uj GiKnNPgehS0jVnb+qXUgjJll+z6FMtl2j4v7vei86CJvmnYDzqcxzWMvOGvpJw==
Message-ID: <5abba704-753d-107b-4ec5-34857985a64a@datashrine.de>
Date: Fri, 10 Dec 2021 19:14:58 +0100
MIME-Version: 1.0
Content-Language: en-US
To: mls@ietf.org
References: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de> <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com>
From: Konrad Kohbrok <konrad.kohbrok@datashrine.de>
In-Reply-To: <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/QbYVKHQ5xzFDZEB4vLMN4urdGr0>
Subject: Re: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Dec 2021 18:15:15 -0000

Hi Richard,

replies inline below.

On 10/12/2021 17:29, Richard Barnes wrote:
> Hi Konrad,
> 
> Thanks for thinking through this.  I mocked this up as a test case in 
> mlspp, and I can confirm that it breaks there too.
> 
> https://github.com/cisco/mlspp/compare/truncate-parent?expand=1 
> <https://github.com/cisco/mlspp/compare/truncate-parent?expand=1>
> 
> A couple of thoughts here...
> 
> # Putting blanks in update paths
> 
> It occurs to me that there is a different solution approach available here,
> which preserves the sparsity of the tree, and even makes commits a 
> little more
> efficient in some cases.
> 
> The starting point here is to observe that the current update path algorithm
> adds useless intermediate nodes.  The reason the parent hash fails in your
> example is that G added a useless intermediate node.  Since G is the 
> only child
> of 13, that node could just as well have been left blank.  The resolution
> algorithm would then result in the same number of encryptions when someone
> elsewhere in the tree updated.
> 
> This is a small fix to the update path generation / processing 
> algorithms.  When
> the resolution of the copath node is empty, you simply set the parent 
> node to a
> blank node instead of a populated parent node.
> 
> For the parent hash computation: Since blank nodes are all the same for 
> parent
> hash, if the receiver of a tree knows where to put the blanks, then it 
> can add
> them into the parent hash computation.  So the main work here would be 
> to (1)
> update the parent hash algorithm so that it can cover blank nodes, and 
> (2) add
> some syntax to the ParentHash extension that describes where the blanks 
> go.  If
> we still had a notion of node indices, you could state it that way; less 
> clear
> how to do it otherwise.

This seems like a good idea beyond solving the problem of trimming. Do 
we really need that explicit description in the ParentHashExtension? I 
haven't worked out the algorithm, but I would think that the verifier 
could work out that from the verification perspective in a similar way 
that it can work out where blank nodes have been added to accommodate 
new nodes. More concretely, if a child is blank, it could either be 
because a new node was added, or because the whole subtree under that 
child has only one occupant, which should have the right value in its 
extension.

> To work through an example: Suppose we have the following tree, in which 
> G has
> just sent a commit to remove H.  The direct path sent by G resets nodes 
> 12, 13,
> 11, 7, and 15, but sets node 13 to a blank because its copath resolution is
> blank.
> 
>                                  15
>                   _______________|
>                  /                \
>                 7                 |
>           ______|______           |
>          /             \          |
>         3              11         |
>       __|__           __|__       |
>      /     \         /     \      |
>     1       5       9       _     |
>    / \     / \     / \     / \    |
>   A   B   C   D   E   F   G   _   I
> 
>                       1 1 1 1 1 1 1
>   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
> 
> The parent hash at G is thus over the path (12, _, 11, 7, 15).  We will 
> assume
> that G's parent hash extension indicates that there is a blank in its direct
> path between 12 and 11.
> 
> Now suppose as in your example that A removes I, so that you end up with the
> same tree as in your example.
> 
>                 7
>           ______|______
>          /             \
>         3              11
>       __|__           __|
>      /     \         /   \
>     1       5       9     |
>    / \     / \     / \    |
>   A   B   C   D   E   F   G
> 
>                       1 1 1
>   0 1 2 3 4 5 6 7 8 9 0 1 2
> 
> A recipient seeing this tree can recognize that node 11 is covered by 
> G's parent
> hash, because it will add a virtual blank node when computing the parent 
> hash
> from 11 to G.
> 
> Now, that's pretty complicated, especially when you work out the 
> details.  So
> I'm not sure it's the right answer.  Just wanted to put it out there in the
> interest of completeness.
> 
> # Exponential delete
> 
> I don't think your proposed careful delete solution actually works.  You 
> need
> not only the parent node to be blank, but the whole path to the root.  I'll
> assert that without proof for now, because the counterexample requires an
> inconveniently large tree :)

Can you describe abstractly in what situation this approach would fail? 
I don't see it immediately and I'm curious where this method falls 
short. Although now that I think about it, the "careful" algorithm 
should remove a leaf if it is blank and its parent is either blank or 
the root node.

I believe that should give you pretty much the same result as the 
exponential delete method you're sketching here. But I'd be happy to be 
proven wrong.

> Fortunately, that idea turns into an algorithm that's even simpler: Only
> truncate the tree by removing the whole right side of it.  In the 
> example above,
> after I gets removed, you would keep the blank leaf at node 14, and move the
> root of the tree to node 7.  In an even sparser example:
> 
>                                  15
>                   _______________|
>                  /                \
>                 7                 |
>           ______|______           |
>          /             \          |
>         3               _         |
>       __|__           __|__       |
>      /     \         /     \      |
>     1       _       _       _     |
>    / \     / \     / \     / \    |
>   A   B   _   _   _   _   _   _   I
> 
>                       1 1 1 1 1 1 1
>   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
> 
> ... after removing I you would first chop down to 0..14, then 0..6, then 
> 0..2.
> While root.right.empty(), root = root.left.
 >
> The overall semantic would then be that the tree grows linearly, but shrinks
> exponentially.  (Like TCP!)  That obviously keeps bigger trees around for
> longer, but it ultimately gets the job done.  And an implementation that 
> really
> cares can use Remove+Add move operations to compact the tree.

Do you mean that one would perform one step per commit? Why not just 
shrink the tree down to 0..6 in one go?

> # ...
> 
> Overall, I think my preference here would be to go with the exponential 
> delete
> option. Adding blanks in the parent hash is nice in that it saves some 
> work, but
> the details seem intimidatingly complicated. Exponential delete is a simple,
> easy-to-understand solution that still GC's the tree, just more slowly.
> 
> --Richard
> 
> On Fri, Dec 10, 2021 at 7:18 AM Konrad Kohbrok 
> <konrad.kohbrok@datashrine.de <mailto:konrad.kohbrok@datashrine.de>> wrote:
> 
>     Hi everyone,
> 
> 
> 
>     while testing changes to our tree implementation, we found what we
>     believe is a bug in the specification. More concretely, the tree
>     truncation mandated by the spec is too aggressive and can destroy
>     parent
>     hashes in an otherwise valid tree.
> 
> 
> 
>     For debugging purposes, we had a check that would validate parent
>     hashes
>     of every node every time a commit is processed, which is how we found
>     the bug.
> 
> 
> 
>     Currently, the spec mandates that upon a remove operation, the leaves
>     are removed until the right-most leaf in non-blank. However, this can
>     lead to a situation, where non-blank parent nodes of a non-blank leaf
>     are removed. This removal potentially interrupts valid
>     "parent-hash-chains". More concretely, if the affected leaf node was
>     the
>     last node to commit a path in its subtree, then overly aggressive
>     truncation can lead to the removal of parent nodes in that path.
>     This in
>     turn leads to an error when the parent hash of the parent of the
>     removed
>     parent node is verified. Note that if the parent hash chain is
>     interrupted in this way, the situation is indistinguishable from one
>     where the parent hash of a node is simply invalid.
> 
> 
> 
>     Consider the following example:
> 
> 
> 
>                                     15
> 
>                       _______________|
> 
>                      /                |
> 
>                     7                 |
> 
>               ______|______           |
> 
>              /             \          |
> 
>             3              11         |
> 
>           __|__           __|__       |
> 
>          /     \         /     \      |
> 
>         1       5       9      13     |
> 
>        / \     / \     / \     / \    |
> 
>     A   B   C   D   E   F   G   -   I
> 
> 
> 
>                           1 1 1 1 1 1 1
> 
>     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
> 
> 
> 
>     - G performs an update, leading to a valid parent hash chain along its
>     direct path (13, 11, 7, 15).
> 
>     - A removes I, leading to the following state, since G is the
>     right-most
>     non-blank leaf.
> 
> 
> 
> 
> 
>                     7
> 
>               ______|______
> 
>              /             \
> 
>             3              11
> 
>           __|__           __|
> 
>          /     \         /   \
> 
>         1       5       9     |
> 
>        / \     / \     / \    |
> 
>     A   B   C   D   E   F   G
> 
> 
> 
>                           1 1 1
> 
>     0 1 2 3 4 5 6 7 8 9 0 1 2
> 
> 
> 
>     - Since we have removed 13 in the process of removing (leaf) node 14,
>     verification of the parent hash of node 11 will now fail, since none of
>     its children carries its hash in its parent hash field.
> 
>     - This will become apparent if a new member is added, either by one of
>     the nodes A-D or by any node without a path.
> 
> 
> 
>     As solution, we propose that the right-most leaf is only removed in the
>     process of truncation if both it _and its parent_ are blank.
> 
> 
> 
> 
> 
>     Raphael pointed out that this "careful" truncation leads to sparser
>     trees and thus makes the protocol overall less efficient (larger tree
>     structures need to be stored, longer direct paths with more secrets and
>     key pairs to derive, etc.).
> 
> 
> 
>     We can fix this by having two forms of truncation: A "careful" one, as
>     described above and the one that is already in the spec right now with
>     one caveat.
> 
> 
> 
>     The careful one replaces the one that is currently described in the
>     spec
>     and is thus performed with each removal operation.
> 
> 
> 
>     The one that we have right now is performed before a committer (or the
>     receiver of a commit) applies a direct path, except that it can only
>     remove nodes that are in the direct path of the committer.
> 
> 
> 
>     This should allow us to get the smallest tree that we can without
>     compromising valid parent hash chains.
> 
> 
> 
>     Cheers,
> 
>     Konrad
> 
>     _______________________________________________
>     MLS mailing list
>     MLS@ietf.org <mailto:MLS@ietf.org>
>     https://www.ietf.org/mailman/listinfo/mls
>     <https://www.ietf.org/mailman/listinfo/mls>
> 
> 
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls


From nobody Sun Dec 12 00:55:58 2021
Return-Path: <do_not_reply@mnot.net>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DFC163A08BF for <mls@ietfa.amsl.com>; Sun, 12 Dec 2021 00:55:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=jA4V/eIN; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=fh4iPn3o
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NA9dnXkDk_mp for <mls@ietfa.amsl.com>; Sun, 12 Dec 2021 00:55:50 -0800 (PST)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D2C553A08BD for <mls@ietf.org>; Sun, 12 Dec 2021 00:55:50 -0800 (PST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 118D35C0108 for <mls@ietf.org>; Sun, 12 Dec 2021 02:39:12 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 12 Dec 2021 02:39:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h= content-type:mime-version:from:to:subject; s=fm1; bh=D34CYDbkYrw SZTfSuDBnvem/L0kgmlcWeas5dxLY5bk=; b=jA4V/eINGXUgy+qoFJooup+hU0V SyXxV8qzh7HfvJOBCV+mvrc2r2HpfodTLEFvCFgRQ3weu6F4SeRL8ESyre5W1sJM N/k3ONVnRY+cjBmw06h7W2cYuiZPP118kuqODXEUJSeQo9oKBncJuja21I60Z2g+ QxCiYl0DpSymMjGUtQ4eFD4F5Q0zoczfw/dE45S0BtWYwzEwsp/B4d9KvR9xRf1m ccgeZ6I3w5uQMw0nU9NQJwJqf4ZaceIa2EH+0Nif2JwcUY/afXeSrDQ64+T5BUvv Rpkb0GribYm+nU9IExmIk5oIxgC3GXmvDGEuY3Qe6M1+LKyDGBibd3YKzIw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:from:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=D34CYDbkYrwSZTfSuDBnvem/L0kgmlcWeas5dxLY5bk=; b=fh4iPn3o ewEf3f9eZCbcM/lf1oPNC8GbpXwOmUWOZlBf9ZpRK90OS64x0vmaslk+L4ZxLU9X mTns/XnD9qBZSQco0+1vFqczU8AOKyptMO9BhSj9C99M3eqYvRVIZg9Z2MFuwXS/ 4sHtd8yKpjIwSyFCPSsa1/A1Pk5PjNkGexmJ9Esh3UffH9QV3mKDWuQlirYIWrI4 mYrt50gizZQH67SzBGmzxnuVGDhPVT4BG4Xvphd/lDRqjJDn9MgPt3gjlB6rCVNH 5G+GAj9j8/TL3b8Vx113JWxaiA8GULEzWzjat1LCxD6Amojbx05i7V9xNiSGQ5zA iqOEofh3DDJ18A==
X-ME-Sender: <xms:H6e1YXmN7ro8xqOgt1sMD8CN4JPvReDiUgTxvozOXUAC-LCGTYpbGw> <xme:H6e1Ya0OL4y7VfRBgk6mfU4IeCVzHSpGWbGrxpREm3tk9tgA-ae7EoavTchl2lcAF AjpsCFpz9eZXzCueA>
X-ME-Received: <xmr:H6e1YdoFFXxCVFIL__Fii-FHFrIX-sJ7-sgxl9HMGlroqVG2rt_2QxKn39oxkn6hHyDi0ta20g18-KTSqkun_8DOCQsKPgSNWOSZ0IWBb3yqOGO8EfLvOv3HDZNyv7wv1KXO5Q>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeehgddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucfpohcuuggrthgvuchfihgvlhguucdlgeelmdenuc fjughrpegtggfhvffusegrtddtredttdejnecuhfhrohhmpeftvghpohhsihhtohhrhicu tegtthhivhhithihucfuuhhmmhgrrhihuceuohhtuceoughopghnohhtpghrvghplhihse hmnhhothdrnhgvtheqnecuggftrfgrthhtvghrnhepkeefvdduteejvdefkeehieevuefg fefhteetveegffekffefteffvdelheduieetnecuffhomhgrihhnpehgihhthhhusgdrtg homhenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegu ohgpnhhothgprhgvphhlhiesmhhnohhtrdhnvght
X-ME-Proxy: <xmx:H6e1YfnFEG5q972YAgw8_W3AdyNq3vhmNfV8jNvfUxwJNtXIhacaBQ> <xmx:H6e1YV3F0ZpNhUeztFI1uRBwd3rgRtEagZMvQCg2ESKIjQ8DR3Di7w> <xmx:H6e1YesyRXsSsh66Qb-E2ehvfI_IyfzzSgVRM8EM3i-lm8yBrE8bEw> <xmx:IKe1YTBB20TfUq5QAATxh9UBq9Ohyge1e_ubEjhOd-GTVjH7aPIwrw>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for <mls@ietf.org>;  Sun, 12 Dec 2021 02:39:11 -0500 (EST)
Content-Type: multipart/alternative; boundary="===============8156898702094376544=="
MIME-Version: 1.0
From: Repository Activity Summary Bot <do_not_reply@mnot.net>
To: mls@ietf.org
Message-Id: <20211212085550.D2C553A08BD@ietfa.amsl.com>
Date: Sun, 12 Dec 2021 00:55:50 -0800 (PST)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/xFCBtq46jGon1vC7XG9RzptE63w>
Subject: [MLS] Weekly github digest (MLS Working Group summary)
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Dec 2021 08:55:56 -0000

--===============8156898702094376544==
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"; format="flowed"




Issues
------
* mlswg/mls-protocol (+0/-0/=F0=9F=92=AC5)
  1 issues received 5 new comments:
  - #502 Consolidate resumption PSK definitions (5 by bifurcation, br-hale,=
 kkohbrok, raphaelrobert)
    https://github.com/mlswg/mls-protocol/issues/502=20



Pull requests
-------------
* mlswg/mls-protocol (+2/-0/=F0=9F=92=AC14)
  2 pull requests submitted:
  - Move `wire_format` to a separate tagged-union structure MLSMessage (by =
TWal)
    https://github.com/mlswg/mls-protocol/pull/523=20
  - Generalize tree extend/truncate algorithms (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/522=20

  6 pull requests received 14 new comments:
  - #523 Move `wire_format` to a separate tagged-union structure MLSMessage=
 (2 by TWal, raphaelrobert)
    https://github.com/mlswg/mls-protocol/pull/523=20
  - #522 Generalize tree extend/truncate algorithms (1 by TWal)
    https://github.com/mlswg/mls-protocol/pull/522=20
  - #521 Add algorithms for link-based trees (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/521=20
  - #518 Consolidate resumption PSK cases (1 by br-hale)
    https://github.com/mlswg/mls-protocol/pull/518=20
  - #509 Be explicit that Credentials can attest to multiple identities (6 =
by bifurcation, br-hale, kkohbrok, raphaelrobert)
    https://github.com/mlswg/mls-protocol/pull/509=20
  - #507 Getting rid of the array representation (3 by bifurcation, franzis=
kuskiefer)
    https://github.com/mlswg/mls-protocol/pull/507=20


Repositories tracked by this digest:
-----------------------------------
* https://github.com/mlswg/mls-architecture
* https://github.com/mlswg/mls-protocol
* https://github.com/mlswg/mls-federation

--===============8156898702094376544==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<!doctype html>
<html lang=3D"en">
<head>
<meta charset=3D"utf-8">
<title>Weekly github digest (MLS Working Group summary)</title>
<style>
body { font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;=
 font-size: 14px; }
h2 { margin-top: 3em; color: #A52A2A; font-style: italic; font-weight: norm=
al; }
h3 { margin-bottom:0; margin-top: 2em; font-size: 1.2em; }
h1+h2 { margin-top: 1em; }
a { color: #bb6219; text-decoration: none; }
li { margin-bottom: .35em; }
.repos { margin-bottom: 0; margin-top:0; line-height: 1.2; }
.new { color: red; }
.label { display: inline;
	padding: .2em .6em .3em;
	font-size: 75%;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: .25em;
}
details {
	margin-top: 8em;
	}
summary {
	margin-bottom: 1em;
	cursor: pointer;
}
</style>
</head>

<body>
<h1>Sunday December 12, 2021</h1>


<h2>Issues</h2>

<h3>mlswg/mls-protocol (+0/-0/=F0=9F=92=AC5)</h3>

  <p>1 issues received 5 new comments:</p>
  <ul>
  <li>#502 <a href=3D"https://github.com/mlswg/mls-protocol/issues/502">Con=
solidate resumption PSK definitions</a> (5 by bifurcation, br-hale, kkohbro=
k, raphaelrobert) </li>
  </ul>




<h2>Pull requests</h2>
<h3>mlswg/mls-protocol (+2/-0/=F0=9F=92=AC14)</h3>
  <p class=3D"new">2 pull requests submitted:</p>
  <ul>
  <li>#523 <a href=3D"https://github.com/mlswg/mls-protocol/pull/523">Move =
`wire_format` to a separate tagged-union structure MLSMessage</a> (by TWal)=
 </li>
 =20
  <li>#522 <a href=3D"https://github.com/mlswg/mls-protocol/pull/522">Gener=
alize tree extend/truncate algorithms</a> (by bifurcation) </li>
  </ul>

  <p>6 pull requests received 14 new comments:</p>
  <ul>
  <li>#523 <a href=3D"https://github.com/mlswg/mls-protocol/pull/523">Move =
`wire_format` to a separate tagged-union structure MLSMessage</a> (2 by TWa=
l, raphaelrobert) </li>
 =20
  <li>#522 <a href=3D"https://github.com/mlswg/mls-protocol/pull/522">Gener=
alize tree extend/truncate algorithms</a> (1 by TWal) </li>
 =20
  <li>#521 <a href=3D"https://github.com/mlswg/mls-protocol/pull/521">Add a=
lgorithms for link-based trees</a> (1 by bifurcation) </li>
 =20
  <li>#518 <a href=3D"https://github.com/mlswg/mls-protocol/pull/518">Conso=
lidate resumption PSK cases</a> (1 by br-hale) </li>
 =20
  <li>#509 <a href=3D"https://github.com/mlswg/mls-protocol/pull/509">Be ex=
plicit that Credentials can attest to multiple identities</a> (6 by bifurca=
tion, br-hale, kkohbrok, raphaelrobert) </li>
 =20
  <li>#507 <a href=3D"https://github.com/mlswg/mls-protocol/pull/507">Getti=
ng rid of the array representation</a> (3 by bifurcation, franziskuskiefer)=
 </li>
  </ul>



  <details>
    <summary>Repositories tracked by this digest:</summary>
<ul class=3D"repos">
  <li><a href=3D"https://github.com/mlswg/mls-architecture">https://github.=
com/mlswg/mls-architecture</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-protocol">https://github.com/=
mlswg/mls-protocol</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-federation">https://github.co=
m/mlswg/mls-federation</a></li>
</ul>
</details>
</body>
</html>

--===============8156898702094376544==--


From nobody Tue Dec 14 06:48:25 2021
Return-Path: <rlb@ipv.sx>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 508A83A07AE for <mls@ietfa.amsl.com>; Tue, 14 Dec 2021 06:48:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level: 
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20210112.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aOSiMQ7dHz0u for <mls@ietfa.amsl.com>; Tue, 14 Dec 2021 06:48:17 -0800 (PST)
Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6937B3A0BC4 for <mls@ietf.org>; Tue, 14 Dec 2021 06:48:17 -0800 (PST)
Received: by mail-qt1-x82e.google.com with SMTP id p19so18491613qtw.12 for <mls@ietf.org>; Tue, 14 Dec 2021 06:48:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LOSVSR+mk+jC+IwWT2wzEVuSusUgnrpYA5pQtpIkn7c=; b=dh1MSbSVktimpPQcno2IHfJFfzkjMrN0l+ZLRdar3vhvabiWSyZcl3OWkWqLeHxyM/ ZyzWrwSWnbb0UYHrY0O/prcgjQAP5gP4s0xjuiTRsvTF2GJr96SUOaDjQ/xlU7E+nn4/ 5Wh9mxg3Civd/4a6W61WjORrQl+Z+gbK63lyMRnYf4BV+VocvAORDR4HitvGVBg3l5lC Gu8kAbf2UFov8CyElXAltdkaWUd1kKRrt6pFkfy378LHCqCfm5KiD+/VlbQBcbT0cFRv hvGJdj8iT0p+Eh7gcLPS+bnTZtSbovIUvflIIIwAtKoRA7iuJGmPbKuIIpxrWEqyKrfU rtyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LOSVSR+mk+jC+IwWT2wzEVuSusUgnrpYA5pQtpIkn7c=; b=NoWEZmlssEg+hfwZcVmx6noCKuwiM/zwjTXk4GmkV9k6cbjiuwd7nBdmL38RPbXtP1 Mp7vYdXlPntoZ55fst6Y/MdGQgtmNbs/jnF52xqjSzMs+GkhAXvlj+ZAFWjqvbGBTo5k ZynL34ei0Q3KbkXgLwf5krNVojzP8PZQmbjM18TSjfMXPKpEuZ9XJlwK7XYUPdR3lnJG 5x8Z/BRLQ9kDbsGZTH/4gbGYg1VBT/OFworC4nxH5YRKsdge5KNcJEw1fb+uKYPR5+vv 4Z20LoR/6MJG8wmRH1QjP9Sm9sU9Rx0m0hDV/ZQJblxn9QcK1GkVGERanhYOG1Dazisd qD6w==
X-Gm-Message-State: AOAM531Wz0p+16L98O6qA2PxfL8xT1m7ZpfjGHnkCvBqXriTU4IaCMta c3zzy3QJ59zNZFq3Zar2yHpMWewCvWEzQWULdVWF4npfJ+vQASu8
X-Google-Smtp-Source: ABdhPJySnXIF50NpW8aXuyGvLqY+WguVMXVwi1gIkEC24DAWsoOkwRJ5BaxTJ0923eS1JnBeoDpDvh/Rw4NN34iRTDE=
X-Received: by 2002:a05:622a:1196:: with SMTP id m22mr6509544qtk.290.1639493294641;  Tue, 14 Dec 2021 06:48:14 -0800 (PST)
MIME-Version: 1.0
References: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de> <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com> <D7947582-3982-45E6-89E7-529B24F62F9C@raphaelrobert.com>
In-Reply-To: <D7947582-3982-45E6-89E7-529B24F62F9C@raphaelrobert.com>
From: Richard Barnes <rlb@ipv.sx>
Date: Tue, 14 Dec 2021 09:48:03 -0500
Message-ID: <CAL02cgSqaN8VhC+kVZG53j77eBkRqWYZ3R=yXxT2RwTZAezqpQ@mail.gmail.com>
To: Raphael Robert <ietf@raphaelrobert.com>
Cc: Konrad Kohbrok <konrad.kohbrok@datashrine.de>, mls@ietf.org
Content-Type: multipart/alternative; boundary="00000000000070625005d31c4701"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/NCEu2nIg4tWj8W_74IrO9-SS2DA>
Subject: Re: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Dec 2021 14:48:23 -0000

--00000000000070625005d31c4701
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks, this taxonomy is helpful.  And I think I agree with you on the way
forward.

Just to confirm that I understand your M3, is the following an accurate
restatement of the proposal?

* Define two types of truncation:
  * Aggressive: Remove a leaf if it is blank (what we currently do)
  * Careful: Only remove a leaf if both the leaf and its parent are blank
* Do careful truncation after applying Remove proposals
* Do aggressive truncation after applying all proposals, but before
computing the update path

I think that only works (i.e., doesn't break parent hash) when the
committer is the rightmost leaf in the truncated tree.  Otherwise, you have
parent nodes on the right whose parent hash is getting broken, and the
parent node is not being reset by the update.  You could of course write a
provision that says "if the committer is the rightmost non-blank leaf, then
strip the leaves to the right", but I don't really think the extra branch
in the code (heh) is worth the savings.

So my proposal here would be to do M1 and not M2 or M3.  As a bonus, it's a
short PR!

https://github.com/mlswg/mls-protocol/pull/524

I could be persuaded to do M3 (with the above caveats) if people are keen.
It would basically be another step in the Commit generation / processing
that says "If there are no non-blank leaves to the right of the committer,
truncate the tree so that the committer is the rightmost leaf."

--RLB


On Fri, Dec 10, 2021 at 12:55 PM Raphael Robert <ietf@raphaelrobert.com>
wrote:

> Thanks for verifying it Richard!
>
> Since things get confusing quickly given the complexity of the subject, I
> want to summarise the different mechanisms discussed so far:
>
> M1: Trimming carefully upon removing members
> I think we essentially talk about the same thing here (what you call
> exponential delete). It can be expressed quite simply in the array
> representation. We inspect the rightmost tuple of nodes (parent_node,
> leaf_node) in the array. Previously =E2=80=93 with the aggressive trimmin=
g =E2=80=93 we
> would remove the tuple if leaf_node was blank. What we propose is to only
> remove the tuple when both parent_node and leaf_node are blank.
>
> M2: Trim the direct path of committers by omitting blank nodes
> This is what you proposed in your previous email. I agree that it sounds
> quite involved at first and could have some unforeseen effects elsewhere.
> This approach however seems to have the highest gain of efficiency, becau=
se
> unnecessary parent nodes are removed even before the original trimming
> would occur.
>
> M3: Trim the tree before computing the update path of a commit
> This what Konrad additionally described in his email. In essence, another
> trimming pass starting from the right side of the tree takes place before
> the committer computes the update path. The effect is similar to M2, but =
it
> occurs later in time (namely only once the leaves rough to the committer
> have been removed). This approach does not require to have blanks in the
> direct path, it just potentially shortens the direct path (and therefore
> the update path). The complexity seems moderate and so far I don=E2=80=99=
t this
> could have nasty side effects.
>
> Now, the question is which on of those we would like to mandate in the
> spec. It seems we agree that M1 is uncontroversial as such, we just need =
to
> agree on the details of the algorithm.
> M2 and M3 are mutually exclusive, in that M3 becomes unnecessary if we
> also have M2.
>
> Assuming we don=E2=80=99t come up with more mechanisms, I currently see 3
> approaches:
>
> M1 + M2: Highest efficiency, but also highest complexity
> M1 + M3: Balance between efficiency and complexity
> M1: Conservative choice, slowest shrinking of trees
>
> My take on it is that we should go with M1 for now because it seems to be
> orthogonal to M2/M3 anyway. We can still ponder a bit more about M2/M3 in
> the meantime.
>
> Raphael
>
>
> On 10. Dec 2021, at 17:29, Richard Barnes <rlb@ipv.sx> wrote:
>
> Hi Konrad,
>
> Thanks for thinking through this.  I mocked this up as a test case in
> mlspp, and I can confirm that it breaks there too.
>
> https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D1
>
> A couple of thoughts here...
>
> # Putting blanks in update paths
>
> It occurs to me that there is a different solution approach available her=
e,
> which preserves the sparsity of the tree, and even makes commits a little
> more
> efficient in some cases.
>
> The starting point here is to observe that the current update path
> algorithm
> adds useless intermediate nodes.  The reason the parent hash fails in you=
r
> example is that G added a useless intermediate node.  Since G is the only
> child
> of 13, that node could just as well have been left blank.  The resolution
> algorithm would then result in the same number of encryptions when someon=
e
> elsewhere in the tree updated.
>
> This is a small fix to the update path generation / processing
> algorithms.  When
> the resolution of the copath node is empty, you simply set the parent nod=
e
> to a
> blank node instead of a populated parent node.
>
> For the parent hash computation: Since blank nodes are all the same for
> parent
> hash, if the receiver of a tree knows where to put the blanks, then it ca=
n
> add
> them into the parent hash computation.  So the main work here would be to
> (1)
> update the parent hash algorithm so that it can cover blank nodes, and (2=
)
> add
> some syntax to the ParentHash extension that describes where the blanks
> go.  If
> we still had a notion of node indices, you could state it that way; less
> clear
> how to do it otherwise.
>
> To work through an example: Suppose we have the following tree, in which =
G
> has
> just sent a commit to remove H.  The direct path sent by G resets nodes
> 12, 13,
> 11, 7, and 15, but sets node 13 to a blank because its copath resolution =
is
> blank.
>
>                                 15
>                  _______________|
>                 /                \
>                7                 |
>          ______|______           |
>         /             \          |
>        3              11         |
>      __|__           __|__       |
>     /     \         /     \      |
>    1       5       9       _     |
>   / \     / \     / \     / \    |
>  A   B   C   D   E   F   G   _   I
>
>                      1 1 1 1 1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>
> The parent hash at G is thus over the path (12, _, 11, 7, 15).  We will
> assume
> that G's parent hash extension indicates that there is a blank in its
> direct
> path between 12 and 11.
>
> Now suppose as in your example that A removes I, so that you end up with
> the
> same tree as in your example.
>
>                7
>          ______|______
>         /             \
>        3              11
>      __|__           __|
>     /     \         /   \
>    1       5       9     |
>   / \     / \     / \    |
>  A   B   C   D   E   F   G
>
>                      1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2
>
> A recipient seeing this tree can recognize that node 11 is covered by G's
> parent
> hash, because it will add a virtual blank node when computing the parent
> hash
> from 11 to G.
>
> Now, that's pretty complicated, especially when you work out the details.
> So
> I'm not sure it's the right answer.  Just wanted to put it out there in t=
he
> interest of completeness.
>
> # Exponential delete
>
> I don't think your proposed careful delete solution actually works.  You
> need
> not only the parent node to be blank, but the whole path to the root.  I'=
ll
> assert that without proof for now, because the counterexample requires an
> inconveniently large tree :)
>
> Fortunately, that idea turns into an algorithm that's even simpler: Only
> truncate the tree by removing the whole right side of it.  In the example
> above,
> after I gets removed, you would keep the blank leaf at node 14, and move
> the
> root of the tree to node 7.  In an even sparser example:
>
>                                 15
>                  _______________|
>                 /                \
>                7                 |
>          ______|______           |
>         /             \          |
>        3               _         |
>      __|__           __|__       |
>     /     \         /     \      |
>    1       _       _       _     |
>   / \     / \     / \     / \    |
>  A   B   _   _   _   _   _   _   I
>
>                      1 1 1 1 1 1 1
>  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>
> ... after removing I you would first chop down to 0..14, then 0..6, then
> 0..2.
> While root.right.empty(), root =3D root.left.
>
> The overall semantic would then be that the tree grows linearly, but
> shrinks
> exponentially.  (Like TCP!)  That obviously keeps bigger trees around for
> longer, but it ultimately gets the job done.  And an implementation that
> really
> cares can use Remove+Add move operations to compact the tree.
>
> # ...
>
> Overall, I think my preference here would be to go with the exponential
> delete
> option. Adding blanks in the parent hash is nice in that it saves some
> work, but
> the details seem intimidatingly complicated. Exponential delete is a
> simple,
> easy-to-understand solution that still GC's the tree, just more slowly.
>
> --Richard
>
> On Fri, Dec 10, 2021 at 7:18 AM Konrad Kohbrok <
> konrad.kohbrok@datashrine.de> wrote:
>
>> Hi everyone,
>>
>>
>>
>> while testing changes to our tree implementation, we found what we
>> believe is a bug in the specification. More concretely, the tree
>> truncation mandated by the spec is too aggressive and can destroy parent
>> hashes in an otherwise valid tree.
>>
>>
>>
>> For debugging purposes, we had a check that would validate parent hashes
>> of every node every time a commit is processed, which is how we found
>> the bug.
>>
>>
>>
>> Currently, the spec mandates that upon a remove operation, the leaves
>> are removed until the right-most leaf in non-blank. However, this can
>> lead to a situation, where non-blank parent nodes of a non-blank leaf
>> are removed. This removal potentially interrupts valid
>> "parent-hash-chains". More concretely, if the affected leaf node was the
>> last node to commit a path in its subtree, then overly aggressive
>> truncation can lead to the removal of parent nodes in that path. This in
>> turn leads to an error when the parent hash of the parent of the removed
>> parent node is verified. Note that if the parent hash chain is
>> interrupted in this way, the situation is indistinguishable from one
>> where the parent hash of a node is simply invalid.
>>
>>
>>
>> Consider the following example:
>>
>>
>>
>>                                15
>>
>>                  _______________|
>>
>>                 /                |
>>
>>                7                 |
>>
>>          ______|______           |
>>
>>         /             \          |
>>
>>        3              11         |
>>
>>      __|__           __|__       |
>>
>>     /     \         /     \      |
>>
>>    1       5       9      13     |
>>
>>   / \     / \     / \     / \    |
>>
>> A   B   C   D   E   F   G   -   I
>>
>>
>>
>>                      1 1 1 1 1 1 1
>>
>> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
>>
>>
>>
>> - G performs an update, leading to a valid parent hash chain along its
>> direct path (13, 11, 7, 15).
>>
>> - A removes I, leading to the following state, since G is the right-most
>> non-blank leaf.
>>
>>
>>
>>
>>
>>                7
>>
>>          ______|______
>>
>>         /             \
>>
>>        3              11
>>
>>      __|__           __|
>>
>>     /     \         /   \
>>
>>    1       5       9     |
>>
>>   / \     / \     / \    |
>>
>> A   B   C   D   E   F   G
>>
>>
>>
>>                      1 1 1
>>
>> 0 1 2 3 4 5 6 7 8 9 0 1 2
>>
>>
>>
>> - Since we have removed 13 in the process of removing (leaf) node 14,
>> verification of the parent hash of node 11 will now fail, since none of
>> its children carries its hash in its parent hash field.
>>
>> - This will become apparent if a new member is added, either by one of
>> the nodes A-D or by any node without a path.
>>
>>
>>
>> As solution, we propose that the right-most leaf is only removed in the
>> process of truncation if both it _and its parent_ are blank.
>>
>>
>>
>>
>>
>> Raphael pointed out that this "careful" truncation leads to sparser
>> trees and thus makes the protocol overall less efficient (larger tree
>> structures need to be stored, longer direct paths with more secrets and
>> key pairs to derive, etc.).
>>
>>
>>
>> We can fix this by having two forms of truncation: A "careful" one, as
>> described above and the one that is already in the spec right now with
>> one caveat.
>>
>>
>>
>> The careful one replaces the one that is currently described in the spec
>> and is thus performed with each removal operation.
>>
>>
>>
>> The one that we have right now is performed before a committer (or the
>> receiver of a commit) applies a direct path, except that it can only
>> remove nodes that are in the direct path of the committer.
>>
>>
>>
>> This should allow us to get the smallest tree that we can without
>> compromising valid parent hash chains.
>>
>>
>>
>> Cheers,
>>
>> Konrad
>>
>> _______________________________________________
>> MLS mailing list
>> MLS@ietf.org
>> https://www.ietf.org/mailman/listinfo/mls
>>
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls
>
>
>

--00000000000070625005d31c4701
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Thanks, this taxonomy is helpful.=C2=A0 And I think I=
 agree with you on the way forward.</div><div><br></div><div>Just to confir=
m that I understand your M3, is the following an accurate restatement of th=
e proposal?</div><div><br></div><div>* Define two types of truncation:</div=
><div>=C2=A0 * Aggressive: Remove a leaf if it is blank (what we currently =
do)<br></div><div>=C2=A0 * Careful: Only remove a leaf if both the leaf and=
 its parent are blank</div><div>* Do careful truncation after applying Remo=
ve proposals</div><div>* Do aggressive truncation after applying all propos=
als, but before computing the update path</div><div><br></div><div>I think =
that only works (i.e., doesn&#39;t break parent hash) when the committer is=
 the rightmost leaf in the truncated tree.=C2=A0 Otherwise, you have parent=
 nodes on the right whose parent hash is getting broken, and the parent nod=
e is not being reset by the update.=C2=A0 You could of course write a provi=
sion that says &quot;if the committer is the rightmost non-blank leaf, then=
 strip the leaves to the right&quot;, but I don&#39;t really think the extr=
a branch in the code (heh) is worth the savings.<br></div><div><br></div><d=
iv>So my proposal here would be to do M1 and not M2 or M3.=C2=A0 As a bonus=
, it&#39;s a short PR!<br><br><a href=3D"https://github.com/mlswg/mls-proto=
col/pull/524">https://github.com/mlswg/mls-protocol/pull/524</a></div><div>=
<br></div><div>I could be persuaded to do M3 (with the above caveats) if pe=
ople are keen.=C2=A0 It would basically be another step in the Commit gener=
ation / processing that says &quot;If there are no non-blank leaves to the =
right of the committer, truncate the tree so that the committer is the righ=
tmost leaf.&quot;<br></div><div><br></div><div>--RLB<br></div><div><br></di=
v><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"=
>On Fri, Dec 10, 2021 at 12:55 PM Raphael Robert &lt;<a href=3D"mailto:ietf=
@raphaelrobert.com">ietf@raphaelrobert.com</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex"><div style=3D"overflow-wrap: brea=
k-word;">Thanks for verifying it Richard!<div><br></div><div>Since things g=
et confusing quickly given the complexity of the subject, I want to summari=
se the different mechanisms discussed so far:</div><div><br></div><div>M1: =
Trimming carefully upon removing members</div><div>I think we essentially t=
alk about the same thing here (what you call exponential delete). It can be=
 expressed quite simply in the array representation. We inspect the rightmo=
st tuple of nodes (parent_node, leaf_node) in the array. Previously =E2=80=
=93 with the aggressive trimming =E2=80=93 we would remove the tuple if lea=
f_node was blank. What we propose is to only remove the tuple when both par=
ent_node and leaf_node are blank.</div><div><br></div><div>M2: Trim the dir=
ect path of committers by omitting blank nodes</div><div>This is what you p=
roposed in your previous email. I agree that it sounds quite involved at fi=
rst and could have some unforeseen effects elsewhere. This approach however=
 seems to have the highest gain of efficiency, because unnecessary parent n=
odes are removed even before the original trimming would occur.</div><div><=
br></div><div>M3: Trim the tree before computing the update path of a commi=
t</div><div>This what Konrad additionally described in his email. In essenc=
e, another trimming pass starting from the right side of the tree takes pla=
ce before the committer computes the update path. The effect is similar to =
M2, but it occurs later in time (namely only once the leaves rough to the c=
ommitter have been removed). This approach does not require to have blanks =
in the direct path, it just potentially shortens the direct path (and there=
fore the update path). The complexity seems moderate and so far I don=E2=80=
=99t this could have nasty side effects.</div><div><br></div><div>Now, the =
question is which on of those we would like to mandate in the spec. It seem=
s we agree that M1 is uncontroversial as such, we just need to agree on the=
 details of the algorithm.</div><div>M2 and M3 are mutually exclusive, in t=
hat M3 becomes unnecessary if we also have M2.</div><div><br></div><div>Ass=
uming we don=E2=80=99t come up with more mechanisms, I currently see 3 appr=
oaches:</div><div><br></div><div>M1 + M2: Highest efficiency, but also high=
est complexity</div><div>M1 + M3: Balance between efficiency and complexity=
</div><div>M1: Conservative choice, slowest shrinking of trees</div><div><b=
r></div><div>My take on it is that we should go with M1 for now because it =
seems to be orthogonal to M2/M3 anyway. We can still ponder a bit more abou=
t M2/M3 in the meantime.</div><div><br></div><div>Raphael</div><div><br></d=
iv><div><div><br><blockquote type=3D"cite"><div>On 10. Dec 2021, at 17:29, =
Richard Barnes &lt;<a href=3D"mailto:rlb@ipv.sx" target=3D"_blank">rlb@ipv.=
sx</a>&gt; wrote:</div><br><div><div dir=3D"ltr"><div>Hi Konrad,<br><br>Tha=
nks for thinking through this.=C2=A0 I mocked this up as a test case in mls=
pp, and I can confirm that it breaks there too.<br><br><a href=3D"https://g=
ithub.com/cisco/mlspp/compare/truncate-parent?expand=3D1" target=3D"_blank"=
>https://github.com/cisco/mlspp/compare/truncate-parent?expand=3D1</a><br><=
br></div>A couple of thoughts here...<br><div><br># Putting blanks in updat=
e paths<br><div><br></div><div>It occurs to me that there is a different so=
lution approach available here,<br>which preserves the sparsity of the tree=
, and even makes commits a little more<br>efficient in some cases.</div><di=
v><br></div>The starting point here is to observe that the current update p=
ath algorithm<br>adds useless intermediate nodes.=C2=A0 The reason the pare=
nt hash fails in your<br>example is that G added a useless intermediate nod=
e.=C2=A0 Since G is the only child<br>of 13, that node could just as well h=
ave been left blank.=C2=A0 The resolution<br>algorithm would then result in=
 the same number of encryptions when someone<br>elsewhere in the tree updat=
ed.<br><br>This is a small fix to the update path generation / processing a=
lgorithms.=C2=A0 When<br>the resolution of the copath node is empty, you si=
mply set the parent node to a<br>blank node instead of a populated parent n=
ode.<br><br>For the parent hash computation: Since blank nodes are all the =
same for parent<br>hash, if the receiver of a tree knows where to put the b=
lanks, then it can add<br>them into the parent hash computation.=C2=A0 So t=
he main work here would be to (1)<br>update the parent hash algorithm so th=
at it can cover blank nodes, and (2) add<br>some syntax to the ParentHash e=
xtension that describes where the blanks go.=C2=A0 If<br>we still had a not=
ion of node indices, you could state it that way; less clear<br>how to do i=
t otherwise.<br><br>To work through an example: Suppose we have the followi=
ng tree, in which G has<br>just sent a commit to remove H.=C2=A0 The direct=
 path sent by G resets nodes 12, 13,<br>11, 7, and 15, but sets node 13 to =
a blank because its copath resolution is<br>blank.<br><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 15<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0_______________|<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0______|______ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0|<br>=C2=A0 =C2=A0 =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A011 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=
=A0 =C2=A0__|__ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __|__ =C2=A0 =C2=A0 =C2=
=A0 |<br>=C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=
=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0|<br>=C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 5=
 =C2=A0 =C2=A0 =C2=A0 9 =C2=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 |<br>=C2=A0 / =
\ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0|<br>=
=C2=A0A =C2=A0 B =C2=A0 C =C2=A0 D =C2=A0 E =C2=A0 F =C2=A0 G =C2=A0 _ =C2=
=A0 I<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A01 1 1 1 1 1 1<br>=C2=A00 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br><=
br>The parent hash at G is thus over the path (12, _, 11, 7, 15).=C2=A0 We =
will assume<br>that G&#39;s parent hash extension indicates that there is a=
 blank in its direct<br>path between 12 and 11.<br><br>Now suppose as in yo=
ur example that A removes I, so that you end up with the<br>same tree as in=
 your example.<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A07<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 / =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A011<br>=
=C2=A0 =C2=A0 =C2=A0__|__ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __|<br>=C2=A0 =
=C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 \<br>=C2=A0 =
=C2=A01 =C2=A0 =C2=A0 =C2=A0 5 =C2=A0 =C2=A0 =C2=A0 9 =C2=A0 =C2=A0 |<br>=
=C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0|<br>=C2=A0A =
=C2=A0 B =C2=A0 C =C2=A0 D =C2=A0 E =C2=A0 F =C2=A0 G<br><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01 1 1<br>=C2=
=A00 1 2 3 4 5 6 7 8 9 0 1 2<br><br>A recipient seeing this tree can recogn=
ize that node 11 is covered by G&#39;s parent<br>hash, because it will add =
a virtual blank node when computing the parent hash<br>from 11 to G.<br><br=
>Now, that&#39;s pretty complicated, especially when you work out the detai=
ls.=C2=A0 So<br>I&#39;m not sure it&#39;s the right answer.=C2=A0 Just want=
ed to put it out there in the<br>interest of completeness.<br><br># Exponen=
tial delete<br><br>I don&#39;t think your proposed careful delete solution =
actually works.=C2=A0 You need<br>not only the parent node to be blank, but=
 the whole path to the root.=C2=A0 I&#39;ll<br>assert that without proof fo=
r now, because the counterexample requires an<br>inconveniently large tree =
:)<br><br>Fortunately, that idea turns into an algorithm that&#39;s even si=
mpler: Only<br>truncate the tree by removing the whole right side of it.=C2=
=A0 In the example above,<br>after I gets removed, you would keep the blank=
 leaf at node 14, and move the<br>root of the tree to node 7.=C2=A0 In an e=
ven sparser example:<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 15<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_____________=
__|<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______ =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 _ =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 =C2=A0__|__ =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 __|__ =C2=A0 =C2=A0 =C2=A0 |<br>=C2=A0 =C2=A0 / =
=C2=A0 =C2=A0 \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 / =C2=A0 =C2=A0 \ =C2=A0 =C2=A0=
 =C2=A0|<br>=C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 =C2=A0 _ =
=C2=A0 =C2=A0 =C2=A0 _ =C2=A0 =C2=A0 |<br>=C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=
=A0 =C2=A0 / \ =C2=A0 =C2=A0 / \ =C2=A0 =C2=A0|<br>=C2=A0A =C2=A0 B =C2=A0 =
_ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 _ =C2=A0 I<br><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01 1 1 1 1=
 1 1<br>=C2=A00 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br><br>... after removing I=
 you would first chop down to 0..14, then 0..6, then 0..2.<br>While root.ri=
ght.empty(), root =3D root.left.<br><br>The overall semantic would then be =
that the tree grows linearly, but shrinks<br>exponentially. =C2=A0(Like TCP=
!) =C2=A0That obviously keeps bigger trees around for<br>longer, but it ult=
imately gets the job done.=C2=A0 And an implementation that really<br>cares=
 can use Remove+Add move operations to compact the tree.<br><br># ...<br><b=
r>Overall, I think my preference here would be to go with the exponential d=
elete<br>option. Adding blanks in the parent hash is nice in that it saves =
some work, but<br>the details seem intimidatingly complicated. Exponential =
delete is a simple,<br>easy-to-understand solution that still GC&#39;s the =
tree, just more slowly.<br><br>--Richard<br></div></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 10, 2021 at 7=
:18 AM Konrad Kohbrok &lt;<a href=3D"mailto:konrad.kohbrok@datashrine.de" t=
arget=3D"_blank">konrad.kohbrok@datashrine.de</a>&gt; wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
<br>
<br>
while testing changes to our tree implementation, we found what we <br>
believe is a bug in the specification. More concretely, the tree <br>
truncation mandated by the spec is too aggressive and can destroy parent <b=
r>
hashes in an otherwise valid tree.<br>
<br>
<br>
<br>
For debugging purposes, we had a check that would validate parent hashes <b=
r>
of every node every time a commit is processed, which is how we found <br>
the bug.<br>
<br>
<br>
<br>
Currently, the spec mandates that upon a remove operation, the leaves <br>
are removed until the right-most leaf in non-blank. However, this can <br>
lead to a situation, where non-blank parent nodes of a non-blank leaf <br>
are removed. This removal potentially interrupts valid <br>
&quot;parent-hash-chains&quot;. More concretely, if the affected leaf node =
was the <br>
last node to commit a path in its subtree, then overly aggressive <br>
truncation can lead to the removal of parent nodes in that path. This in <b=
r>
turn leads to an error when the parent hash of the parent of the removed <b=
r>
parent node is verified. Note that if the parent hash chain is <br>
interrupted in this way, the situation is indistinguishable from one <br>
where the parent hash of a node is simply invalid.<br>
<br>
<br>
<br>
Consider the following example:<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A015<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_____________=
__|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A03=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 11=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 =C2=A0__|__=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__|__=C2=
=A0 =C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/=C2=
=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 |<br>
<br>
=C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 =C2=A0 =C2=A0 =C2=A09=C2=
=A0 =C2=A0 =C2=A0 13=C2=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 / \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=
=A0/ \=C2=A0 =C2=A0 |<br>
<br>
A=C2=A0 =C2=A0B=C2=A0 =C2=A0C=C2=A0 =C2=A0D=C2=A0 =C2=A0E=C2=A0 =C2=A0F=C2=
=A0 =C2=A0G=C2=A0 =C2=A0-=C2=A0 =C2=A0I<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A01 1 1 1 1 1 1<br>
<br>
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6<br>
<br>
<br>
<br>
- G performs an update, leading to a valid parent hash chain along its <br>
direct path (13, 11, 7, 15).<br>
<br>
- A removes I, leading to the following state, since G is the right-most <b=
r>
non-blank leaf.<br>
<br>
<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0______|______<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0\<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A03=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 11<br>
<br>
=C2=A0 =C2=A0 =C2=A0__|__=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__|<br>
<br>
=C2=A0 =C2=A0 /=C2=A0 =C2=A0 =C2=A0\=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/=C2=
=A0 =C2=A0\<br>
<br>
=C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A05=C2=A0 =C2=A0 =C2=A0 =C2=A09=C2=
=A0 =C2=A0 =C2=A0|<br>
<br>
=C2=A0 / \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 =C2=A0/ \=C2=A0 =C2=A0 |<br>
<br>
A=C2=A0 =C2=A0B=C2=A0 =C2=A0C=C2=A0 =C2=A0D=C2=A0 =C2=A0E=C2=A0 =C2=A0F=C2=
=A0 =C2=A0G<br>
<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A01 1 1<br>
<br>
0 1 2 3 4 5 6 7 8 9 0 1 2<br>
<br>
<br>
<br>
- Since we have removed 13 in the process of removing (leaf) node 14, <br>
verification of the parent hash of node 11 will now fail, since none of <br=
>
its children carries its hash in its parent hash field.<br>
<br>
- This will become apparent if a new member is added, either by one of <br>
the nodes A-D or by any node without a path.<br>
<br>
<br>
<br>
As solution, we propose that the right-most leaf is only removed in the <br=
>
process of truncation if both it _and its parent_ are blank.<br>
<br>
<br>
<br>
<br>
<br>
Raphael pointed out that this &quot;careful&quot; truncation leads to spars=
er <br>
trees and thus makes the protocol overall less efficient (larger tree <br>
structures need to be stored, longer direct paths with more secrets and <br=
>
key pairs to derive, etc.).<br>
<br>
<br>
<br>
We can fix this by having two forms of truncation: A &quot;careful&quot; on=
e, as <br>
described above and the one that is already in the spec right now with <br>
one caveat.<br>
<br>
<br>
<br>
The careful one replaces the one that is currently described in the spec <b=
r>
and is thus performed with each removal operation.<br>
<br>
<br>
<br>
The one that we have right now is performed before a committer (or the <br>
receiver of a commit) applies a direct path, except that it can only <br>
remove nodes that are in the direct path of the committer.<br>
<br>
<br>
<br>
This should allow us to get the smallest tree that we can without <br>
compromising valid parent hash chains.<br>
<br>
<br>
<br>
Cheers,<br>
<br>
Konrad<br>
<br>
_______________________________________________<br>
MLS mailing list<br>
<a href=3D"mailto:MLS@ietf.org" target=3D"_blank">MLS@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/mls" rel=3D"noreferrer" ta=
rget=3D"_blank">https://www.ietf.org/mailman/listinfo/mls</a><br>
</blockquote></div>
_______________________________________________<br>MLS mailing list<br><a h=
ref=3D"mailto:MLS@ietf.org" target=3D"_blank">MLS@ietf.org</a><br><a href=
=3D"https://www.ietf.org/mailman/listinfo/mls" target=3D"_blank">https://ww=
w.ietf.org/mailman/listinfo/mls</a><br></div></blockquote></div><br></div><=
/div></blockquote></div></div></div>

--00000000000070625005d31c4701--


From nobody Tue Dec 14 06:48:36 2021
Return-Path: <rlb@ipv.sx>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E81043A0D69 for <mls@ietfa.amsl.com>; Tue, 14 Dec 2021 06:48:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level: 
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20210112.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o4oDP2lk_kb5 for <mls@ietfa.amsl.com>; Tue, 14 Dec 2021 06:48:23 -0800 (PST)
Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C9E593A0794 for <mls@ietf.org>; Tue, 14 Dec 2021 06:48:22 -0800 (PST)
Received: by mail-qk1-x72e.google.com with SMTP id g28so16900118qkk.9 for <mls@ietf.org>; Tue, 14 Dec 2021 06:48:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Avl9mHOVkvpfK/sT9ZKcQ7csnFAqaNeocLXLuyAA+dg=; b=bM3mWbF5bDydsG5m9SZP8qmVrKhT5hlFi8B218r6q2nC1eMScMzAMPkTfAzIBcQytT F8VkzeRdjMFsz9x9nkXNxVTOD9Qzxmg8wRwg1OkY+qoY1qJk3iAs0vNrJ6NYXa205TRB QkRPemjJd1D+Ojo04JxvTjYKt1Sig9Od+9fgCIhmQ2T72LWaWI92BI1/am9I90Rvu5qf +Xr9gB2ebSvWhXBT8fvpSoOdpfVS/oVCSUI5erJPS5TpStXvmpgJdY9CqddL0DRGVxv5 h498VcubbWIatj5R99BtAIhktW5NxlimgETGQ3EqMUl3jOTqzheytH/ueFMA2Z60ARzZ +Drg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Avl9mHOVkvpfK/sT9ZKcQ7csnFAqaNeocLXLuyAA+dg=; b=qczyBbTs8+mMkUoVB1as3J0aQ/8La0hHnCAKO32rsvSEss7T1VeKeOr0vb85x3Tq9P r4egkbcfZt2+z2bFrM2O0is5ENDs+363ptLJeMMg1dwlYDabHcDkQ24z16WvdgL+brSr AD0TXpvzjiYvkQtwPTfOPeYWVw8PSkD2Ebh+ZZVQl4otVZEn1OjeM+v8YtmyYDA0NCu1 mHM+Ds7GZOZ9P6nW3wmbYSTW4l/LIQ2CadCIlAXapDzKAnwZ+chfoo5i53plFcDbeLfm 2JPo/CMEK5/mI7UUeOCwCzzj4h+dJyAOVMdLqL7VZQlSz8xwMtIPBwzOCqMu5dFuen+h DFMg==
X-Gm-Message-State: AOAM530DsUaYOrbrBc4a0ZvxuQzbnG85qYJ6U58h+o/qzhkGqXnZt9oT u1NMWx012iggGV/WBUVfcz8FEvlEPVe/Ijzrzpa3vMUskgIwWw==
X-Google-Smtp-Source: ABdhPJyDB8LjhFNdLnWlV3FK0FFjUSDFLGVxbwNax2yI1uZjyw115d4hT3UvNxugCGqYE2EFBfoQcpltpY/tyAFo5SI=
X-Received: by 2002:ae9:e905:: with SMTP id x5mr4417263qkf.468.1639493300708;  Tue, 14 Dec 2021 06:48:20 -0800 (PST)
MIME-Version: 1.0
References: <a5eaba7c-0d90-d032-0ba2-bb043d691ae4@datashrine.de> <CAL02cgSYOiJdLG9AdUidJ7WmL8gqDO0kCYOT2E9sT3iM3AsZkw@mail.gmail.com> <5abba704-753d-107b-4ec5-34857985a64a@datashrine.de>
In-Reply-To: <5abba704-753d-107b-4ec5-34857985a64a@datashrine.de>
From: Richard Barnes <rlb@ipv.sx>
Date: Tue, 14 Dec 2021 09:48:09 -0500
Message-ID: <CAL02cgQ3csVPrmZ5nKXUWUcRtQypV8gpw=eoSvsh8A2pVUJy7w@mail.gmail.com>
To: Konrad Kohbrok <konrad.kohbrok@datashrine.de>
Cc: mls@ietf.org
Content-Type: multipart/alternative; boundary="000000000000ccfbed05d31c471e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/jXXG5zUP3MT50O99hPpTDk57pUk>
Subject: Re: [MLS] Overly aggressive tree trimming can break parent hashes
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Dec 2021 14:48:34 -0000

--000000000000ccfbed05d31c471e
Content-Type: text/plain; charset="UTF-8"

Inline, with some trimming...

On Fri, Dec 10, 2021 at 1:15 PM Konrad Kohbrok <konrad.kohbrok@datashrine.de>
wrote:

> > For the parent hash computation: Since blank nodes are all the same for
> > parent
> > hash, if the receiver of a tree knows where to put the blanks, then it
> > can add
> > them into the parent hash computation.  So the main work here would be
> > to (1)
> > update the parent hash algorithm so that it can cover blank nodes, and
> > (2) add
> > some syntax to the ParentHash extension that describes where the blanks
> > go.  If
> > we still had a notion of node indices, you could state it that way; less
> > clear
> > how to do it otherwise.
>
> This seems like a good idea beyond solving the problem of trimming. Do
> we really need that explicit description in the ParentHashExtension? I
> haven't worked out the algorithm, but I would think that the verifier
> could work out that from the verification perspective in a similar way
> that it can work out where blank nodes have been added to accommodate
> new nodes. More concretely, if a child is blank, it could either be
> because a new node was added, or because the whole subtree under that
> child has only one occupant, which should have the right value in its
> extension.
>

You might be able to get away with something like describing the pattern of
blank leaves in the tree when this node was last updated, if you also
enforced the invariant that a node was blank unless it has two non-blank
children.  But that would still require a whole bunch of algorithms, so I'm
inclined not to do it for now.


> # Exponential delete
> >
> > I don't think your proposed careful delete solution actually works.  You
> > need
> > not only the parent node to be blank, but the whole path to the root.
> I'll
> > assert that without proof for now, because the counterexample requires an
> > inconveniently large tree :)
>
> Can you describe abstractly in what situation this approach would fail?
> I don't see it immediately and I'm curious where this method falls
> short. Although now that I think about it, the "careful" algorithm
> should remove a leaf if it is blank and its parent is either blank or
> the root node.
>
> I believe that should give you pretty much the same result as the
> exponential delete method you're sketching here. But I'd be happy to be
> proven wrong.
>

I tried to construct an example, and I think you're actually right.  Proof
sketch:

* The algorithm to remove the rightmost leaf (see PR#522) always removes
exactly two nodes, the rightmost leaf R and its parent P.  Let L be the
other child of P and Q be the parent of P.
* There are two parent-hash "links" destroyed here, L->P and P->Q.  In the
case that P is the root, Q doesn't exist, and so we can ignore P->Q.
* Removing the L->P link is not harmful, since a link is only needed to
verify a non-blank parent node, and we are removing P.  So L will continue
to have P's parent hash in it, which will be meaningless, but that's
harmless.
* Removing the P->Q link is harmful if Q is non-blank and P was the last
updated child of Q, since then the L->P->Q path is the path that verifies
Q.  However, if P is blank, then it can't be the last updated child.  So if
P is blank, then the P->Q link is not required for parent hash verification
(regardless of whether Q is blank).
* So removing the rightmost leaf doesn't break the parent hash as long as
the parent of the rightmost leaf is either blank or the root.



> > The overall semantic would then be that the tree grows linearly, but
> shrinks
> > exponentially.  (Like TCP!)  That obviously keeps bigger trees around for
> > longer, but it ultimately gets the job done.  And an implementation that
> > really
> > cares can use Remove+Add move operations to compact the tree.
>
> Do you mean that one would perform one step per commit? Why not just
> shrink the tree down to 0..6 in one go?
>

That would be fine, I was just showing the steps :)

I have some thoughts on the way forward here, but I like Raphael's
taxonomy, so I will put them in reply to his message.

--RLB

--000000000000ccfbed05d31c471e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Inline, with some trimming...<br><div dir=3D"ltr"><br></di=
v><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, =
Dec 10, 2021 at 1:15 PM Konrad Kohbrok &lt;<a href=3D"mailto:konrad.kohbrok=
@datashrine.de">konrad.kohbrok@datashrine.de</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">
&gt; For the parent hash computation: Since blank nodes are all the same fo=
r <br>
&gt; parent<br>
&gt; hash, if the receiver of a tree knows where to put the blanks, then it=
 <br>
&gt; can add<br>
&gt; them into the parent hash computation.=C2=A0 So the main work here wou=
ld be <br>
&gt; to (1)<br>
&gt; update the parent hash algorithm so that it can cover blank nodes, and=
 <br>
&gt; (2) add<br>
&gt; some syntax to the ParentHash extension that describes where the blank=
s <br>
&gt; go.=C2=A0 If<br>
&gt; we still had a notion of node indices, you could state it that way; le=
ss <br>
&gt; clear<br>
&gt; how to do it otherwise.<br>
<br>
This seems like a good idea beyond solving the problem of trimming. Do <br>
we really need that explicit description in the ParentHashExtension? I <br>
haven&#39;t worked out the algorithm, but I would think that the verifier <=
br>
could work out that from the verification perspective in a similar way <br>
that it can work out where blank nodes have been added to accommodate <br>
new nodes. More concretely, if a child is blank, it could either be <br>
because a new node was added, or because the whole subtree under that <br>
child has only one occupant, which should have the right value in its <br>
extension.<br></blockquote><div><br></div><div>You might be able to get awa=
y with something like describing the pattern of blank leaves in the tree wh=
en this node was last updated, if you also enforced the invariant that a no=
de was blank unless it has two non-blank children.=C2=A0 But that would sti=
ll require a whole bunch of algorithms, so I&#39;m inclined not to do it fo=
r now.<br></div><div><br></div><div><br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">
&gt; # Exponential delete<br>
&gt; <br>
&gt; I don&#39;t think your proposed careful delete solution actually works=
.=C2=A0 You <br>
&gt; need<br>
&gt; not only the parent node to be blank, but the whole path to the root.=
=C2=A0 I&#39;ll<br>
&gt; assert that without proof for now, because the counterexample requires=
 an<br>
&gt; inconveniently large tree :)<br>
<br>
Can you describe abstractly in what situation this approach would fail? <br=
>
I don&#39;t see it immediately and I&#39;m curious where this method falls =
<br>
short. Although now that I think about it, the &quot;careful&quot; algorith=
m <br>
should remove a leaf if it is blank and its parent is either blank or <br>
the root node.<br>
<br>
I believe that should give you pretty much the same result as the <br>
exponential delete method you&#39;re sketching here. But I&#39;d be happy t=
o be <br>
proven wrong.<br></blockquote><div><br></div><div>I tried to construct an e=
xample, and I think you&#39;re actually right.=C2=A0 Proof sketch:</div><di=
v><br></div><div>* The algorithm to remove the rightmost leaf (see PR#522) =
always removes exactly two nodes, the rightmost leaf R and its parent P.=C2=
=A0 Let L be the other child of P and Q be the parent of P.<br></div><div>*=
 There are two parent-hash &quot;links&quot; destroyed here, L-&gt;P and P-=
&gt;Q.=C2=A0 In the case that P is the root, Q doesn&#39;t exist, and so we=
 can ignore P-&gt;Q.<br></div><div>* Removing the L-&gt;P link is not harmf=
ul, since a link is only needed to verify a non-blank parent node, and we a=
re removing P.=C2=A0 So L will continue to have P&#39;s parent hash in it, =
which will be meaningless, but that&#39;s harmless.</div><div>* Removing th=
e P-&gt;Q link is harmful if Q is non-blank and P was the last updated chil=
d of Q, since then the L-&gt;P-&gt;Q path is the path that verifies Q.=C2=
=A0 However, if P is blank, then it can&#39;t be the last updated child.=C2=
=A0 So if P is blank, then the P-&gt;Q link is not required for parent hash=
 verification (regardless of whether Q is blank).</div><div>* So removing t=
he rightmost leaf doesn&#39;t break the parent hash as long as the parent o=
f the rightmost leaf is either blank or the root.</div><div><br></div><div>=
=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; The overall semantic would then be that the tree grows linearly, but s=
hrinks<br>
&gt; exponentially. =C2=A0(Like TCP!) =C2=A0That obviously keeps bigger tre=
es around for<br>
&gt; longer, but it ultimately gets the job done.=C2=A0 And an implementati=
on that <br>
&gt; really<br>
&gt; cares can use Remove+Add move operations to compact the tree.<br>
<br>
Do you mean that one would perform one step per commit? Why not just <br>
shrink the tree down to 0..6 in one go?<br></blockquote><div><br></div><div=
>That would be fine, I was just showing the steps :)<br></div><div><br></di=
v><div>I have some thoughts on the way forward here, but I like Raphael&#39=
;s taxonomy, so I will put them in reply to his message.<br></div><div><br>=
</div><div>--RLB<br></div></div></div>

--000000000000ccfbed05d31c471e--


From nobody Sat Dec 18 23:46:10 2021
Return-Path: <do_not_reply@mnot.net>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 31A773A09DD for <mls@ietfa.amsl.com>; Sat, 18 Dec 2021 23:46:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=Ie6Z5TYL; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=N0xyYbBo
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fUZCa43M-N_b for <mls@ietfa.amsl.com>; Sat, 18 Dec 2021 23:45:55 -0800 (PST)
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4DB133A09DF for <mls@ietf.org>; Sat, 18 Dec 2021 23:45:55 -0800 (PST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 1CBE032009BD for <mls@ietf.org>; Sun, 19 Dec 2021 02:39:33 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 19 Dec 2021 02:39:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h= content-type:mime-version:from:to:subject; s=fm1; bh=JM00VYLnb7i spVfagIsD7xC5TIxAZT3tNJ+vtfQewLQ=; b=Ie6Z5TYLZf+kvn7PaEggIKciVy/ HWkj+D7rsEw+OOU59qjWf1U807xGOvvbGLj8TJC6ScNlru9vaMo6vCMkd98ZNp0J 1CiwhfevO/levCUjySlGjvoVL/4qxTUQvKfizE/ZBQfEnqV2SP3cbV3paCA1VFrt YPQ2SmUhcZRkJ2X93sZFNhZNzGITTUWD3n2dwEXP548LcZH8rn/pfLlMc/6JH/mI 2/O50hqygDYdpDyaql8tXSzINwTdbEcyJg1WvI4QsEH9IYcE3xg36PYIyKUjSZSp GbJNvPb3t9uOfMCS8/6PxoTd0tk5I6rgN1LgGVjcXxHhk8oA/1FP4sf78qQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:from:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=JM00VYLnb7ispVfagIsD7xC5TIxAZT3tNJ+vtfQewLQ=; b=N0xyYbBo D311gEVDI3vd2bVmOUklEI8DBa59jhJmXG8Ki2g55pz9ZRzOC/VFj/av+p+ZXOUG ErbQwVNwwKa0mVoIYWaGFT//SdQ01g8CZ/7j8nAQ4Y+FI3CIvXrWL6/SKYKD7d2h QOCZB/Dfcfhi6mOwR7/za2yNCB2x1IjNxs4rrsqjkwwzeeK5+FDpvg9V06efKsuH /NrZVHqVpvawxfF/RZSYXXnOv5+Q5Y32fsID1w5GAXWW4vq85XZwueYDoE7i0rMl KpZladAIONaFVdH5MWZHiGbIFmlXq/LJKku309ivFeMUyYNj5kVrpyJZTmpfe98P H1oEtdJ8cB2eCg==
X-ME-Sender: <xms:tOG-YdpYbmuv_I6aWKFkYIPiFWbbHJQLzPdMv9BV-q1UE0RvIw1XHA> <xme:tOG-YfrMvR4OObkXfloghyPTmiKPzU0H5IPCg53UumfOjMq2MuB4OZDvy0mbd7phX Qj7OmopWQ0G-trBkw>
X-ME-Received: <xmr:tOG-YaM60VZzJi1A-cxh1-ZhywTYUfiq9aEGnLlU3oRxy11ZyoIFu_vf2Kvxm8EzuQsVYlJWPLKBv6JQmdyuoWP3xgLuWoCJ02l0-bQBrx3WgIgdV8bI_9om3v6MRS5XyhC1Sg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrleelgddutdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucfpohcuuggrthgvuchfihgvlhguucdlgeelmdenuc fjughrpegtggfhvffusegrtddtredttdejnecuhfhrohhmpeftvghpohhsihhtohhrhicu tegtthhivhhithihucfuuhhmmhgrrhihuceuohhtuceoughopghnohhtpghrvghplhihse hmnhhothdrnhgvtheqnecuggftrfgrthhtvghrnhepkeefvdduteejvdefkeehieevuefg fefhteetveegffekffefteffvdelheduieetnecuffhomhgrihhnpehgihhthhhusgdrtg homhenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegu ohgpnhhothgprhgvphhlhiesmhhnohhtrdhnvght
X-ME-Proxy: <xmx:tOG-YY7V655qwce07bwDVCb09YFoImpHTVSNqmXGPCrXfY8Th6lfuw> <xmx:tOG-Yc5Fc8vILFGr5SEEiKnvD7dzUIr4cArVX3VglFZxUYVmSoveaA> <xmx:tOG-YQhpmq_uVc2A9xrkiGXxJC2hrcE0yqd3gYrAUTXjrp3zWgROhw> <xmx:tOG-YcH-x5c1gBXuzwpzLzq8VWHuMCoXF8BKmFjKOFswNCyxTXJVJg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for <mls@ietf.org>;  Sun, 19 Dec 2021 02:39:32 -0500 (EST)
Content-Type: multipart/alternative; boundary="===============1648201075284686573=="
MIME-Version: 1.0
From: Repository Activity Summary Bot <do_not_reply@mnot.net>
To: mls@ietf.org
Message-Id: <20211219074555.4DB133A09DF@ietfa.amsl.com>
Date: Sat, 18 Dec 2021 23:45:55 -0800 (PST)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/zES5LnXswEXiALrrEKi4-ONjxZY>
Subject: [MLS] Weekly github digest (MLS Working Group summary)
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 19 Dec 2021 07:46:00 -0000

--===============1648201075284686573==
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"; format="flowed"




Issues
------
* mlswg/mls-protocol (+3/-0/=F0=9F=92=AC4)
  3 issues created:
  - MLS version is used inconsistently in strings (by raphaelrobert)
    https://github.com/mlswg/mls-protocol/issues/531=20
  - Require uniqueness of RatchetTreeExtensions in GroupInfo (by kkohbrok)
    https://github.com/mlswg/mls-protocol/issues/530=20
  - Include `context` in `MLSPlaintextTBS` for sender_type `NewMember` (by =
kkohbrok)
    https://github.com/mlswg/mls-protocol/issues/528=20

  1 issues received 4 new comments:
  - #502 Consolidate resumption PSK definitions (4 by bifurcation, br-hale)
    https://github.com/mlswg/mls-protocol/issues/502=20



Pull requests
-------------
* mlswg/mls-protocol (+5/-2/=F0=9F=92=AC17)
  5 pull requests submitted:
  - Refactor Group Joining and fix External Inits (by kkohbrok)
    https://github.com/mlswg/mls-protocol/pull/529=20
  - Stronger parent hashes for authenticated identities (by TWal)
    https://github.com/mlswg/mls-protocol/pull/527=20
  - Unambiguous signatures (by TWal)
    https://github.com/mlswg/mls-protocol/pull/526=20
  - Tighten up branch and reinit; define ResumptionPSKUsage (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/525=20
  - Careful truncation (by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/524=20

  6 pull requests received 17 new comments:
  - #527 Stronger parent hashes for authenticated identities (1 by raphaelr=
obert)
    https://github.com/mlswg/mls-protocol/pull/527=20
  - #526 Unambiguous signatures (3 by TWal, raphaelrobert)
    https://github.com/mlswg/mls-protocol/pull/526=20
  - #525 Tighten up branch and reinit; define ResumptionPSKUsage (4 by TWal=
, br-hale, kkohbrok)
    https://github.com/mlswg/mls-protocol/pull/525=20
  - #523 Move `wire_format` to a separate tagged-union structure MLSMessage=
 (4 by TWal, bifurcation, raphaelrobert)
    https://github.com/mlswg/mls-protocol/pull/523=20
  - #518 Consolidate resumption PSK cases (1 by bifurcation)
    https://github.com/mlswg/mls-protocol/pull/518=20
  - #509 Be explicit that Credentials can attest to multiple identities (4 =
by bifurcation, br-hale)
    https://github.com/mlswg/mls-protocol/pull/509=20

  2 pull requests merged:
  - Generalize tree extend/truncate algorithms
    https://github.com/mlswg/mls-protocol/pull/522=20
  - Revamp overview sections
    https://github.com/mlswg/mls-protocol/pull/520=20


Repositories tracked by this digest:
-----------------------------------
* https://github.com/mlswg/mls-architecture
* https://github.com/mlswg/mls-protocol
* https://github.com/mlswg/mls-federation

--===============1648201075284686573==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<!doctype html>
<html lang=3D"en">
<head>
<meta charset=3D"utf-8">
<title>Weekly github digest (MLS Working Group summary)</title>
<style>
body { font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;=
 font-size: 14px; }
h2 { margin-top: 3em; color: #A52A2A; font-style: italic; font-weight: norm=
al; }
h3 { margin-bottom:0; margin-top: 2em; font-size: 1.2em; }
h1+h2 { margin-top: 1em; }
a { color: #bb6219; text-decoration: none; }
li { margin-bottom: .35em; }
.repos { margin-bottom: 0; margin-top:0; line-height: 1.2; }
.new { color: red; }
.label { display: inline;
	padding: .2em .6em .3em;
	font-size: 75%;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: .25em;
}
details {
	margin-top: 8em;
	}
summary {
	margin-bottom: 1em;
	cursor: pointer;
}
</style>
</head>

<body>
<h1>Sunday December 19, 2021</h1>


<h2>Issues</h2>

<h3>mlswg/mls-protocol (+3/-0/=F0=9F=92=AC4)</h3>
  <p class=3D"new">3 issues created:</p>
  <ul>
  <li>#531 <a href=3D"https://github.com/mlswg/mls-protocol/issues/531">MLS=
 version is used inconsistently in strings</a> (by raphaelrobert) </li>
 =20
  <li>#530 <a href=3D"https://github.com/mlswg/mls-protocol/issues/530">Req=
uire uniqueness of RatchetTreeExtensions in GroupInfo</a> (by kkohbrok) </l=
i>
 =20
  <li>#528 <a href=3D"https://github.com/mlswg/mls-protocol/issues/528">Inc=
lude `context` in `MLSPlaintextTBS` for sender_type `NewMember`</a> (by kko=
hbrok) </li>
  </ul>

  <p>1 issues received 4 new comments:</p>
  <ul>
  <li>#502 <a href=3D"https://github.com/mlswg/mls-protocol/issues/502">Con=
solidate resumption PSK definitions</a> (4 by bifurcation, br-hale) </li>
  </ul>




<h2>Pull requests</h2>
<h3>mlswg/mls-protocol (+5/-2/=F0=9F=92=AC17)</h3>
  <p class=3D"new">5 pull requests submitted:</p>
  <ul>
  <li>#529 <a href=3D"https://github.com/mlswg/mls-protocol/pull/529">Refac=
tor Group Joining and fix External Inits</a> (by kkohbrok) </li>
 =20
  <li>#527 <a href=3D"https://github.com/mlswg/mls-protocol/pull/527">Stron=
ger parent hashes for authenticated identities</a> (by TWal) </li>
 =20
  <li>#526 <a href=3D"https://github.com/mlswg/mls-protocol/pull/526">Unamb=
iguous signatures</a> (by TWal) </li>
 =20
  <li>#525 <a href=3D"https://github.com/mlswg/mls-protocol/pull/525">Tight=
en up branch and reinit; define ResumptionPSKUsage</a> (by bifurcation) </l=
i>
 =20
  <li>#524 <a href=3D"https://github.com/mlswg/mls-protocol/pull/524">Caref=
ul truncation</a> (by bifurcation) </li>
  </ul>

  <p>6 pull requests received 17 new comments:</p>
  <ul>
  <li>#527 <a href=3D"https://github.com/mlswg/mls-protocol/pull/527">Stron=
ger parent hashes for authenticated identities</a> (1 by raphaelrobert) </l=
i>
 =20
  <li>#526 <a href=3D"https://github.com/mlswg/mls-protocol/pull/526">Unamb=
iguous signatures</a> (3 by TWal, raphaelrobert) </li>
 =20
  <li>#525 <a href=3D"https://github.com/mlswg/mls-protocol/pull/525">Tight=
en up branch and reinit; define ResumptionPSKUsage</a> (4 by TWal, br-hale,=
 kkohbrok) </li>
 =20
  <li>#523 <a href=3D"https://github.com/mlswg/mls-protocol/pull/523">Move =
`wire_format` to a separate tagged-union structure MLSMessage</a> (4 by TWa=
l, bifurcation, raphaelrobert) </li>
 =20
  <li>#518 <a href=3D"https://github.com/mlswg/mls-protocol/pull/518">Conso=
lidate resumption PSK cases</a> (1 by bifurcation) </li>
 =20
  <li>#509 <a href=3D"https://github.com/mlswg/mls-protocol/pull/509">Be ex=
plicit that Credentials can attest to multiple identities</a> (4 by bifurca=
tion, br-hale) </li>
  </ul>

  <p>2 pull requests merged:</p>
  <ul>
  <li>#522 <a href=3D"https://github.com/mlswg/mls-protocol/pull/522">Gener=
alize tree extend/truncate algorithms</a> </li>
 =20
  <li>#520 <a href=3D"https://github.com/mlswg/mls-protocol/pull/520">Revam=
p overview sections</a> </li>
  </ul>


  <details>
    <summary>Repositories tracked by this digest:</summary>
<ul class=3D"repos">
  <li><a href=3D"https://github.com/mlswg/mls-architecture">https://github.=
com/mlswg/mls-architecture</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-protocol">https://github.com/=
mlswg/mls-protocol</a></li>
  <li><a href=3D"https://github.com/mlswg/mls-federation">https://github.co=
m/mlswg/mls-federation</a></li>
</ul>
</details>
</body>
</html>

--===============1648201075284686573==--


From nobody Tue Dec 21 06:47:38 2021
Return-Path: <karthikeyan.bhargavan@inria.fr>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 56E6E3A10A8 for <mls@ietfa.amsl.com>; Tue, 21 Dec 2021 06:47:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level: 
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3muZCNK4RSbi for <mls@ietfa.amsl.com>; Tue, 21 Dec 2021 06:47:32 -0800 (PST)
Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 68EC33A10A5 for <mls@ietf.org>; Tue, 21 Dec 2021 06:47:31 -0800 (PST)
IronPort-Data: =?us-ascii?q?A9a23=3AldpS5aq9VUP4W1pKsLzecIFJ1X9eBmL7ZxIvgKr?= =?us-ascii?q?LsJaIsI5as4F+vjcXXj+DaPePYGf3f9onYYnioUgG7ZSDzII2GQFprCpnQiMRo?= =?us-ascii?q?6IpJ/zJdxaqZ3v6wu7rFR88sZ1GMrEsFC2FJ5Pljk/F3oPJ8D8shclkepKmULS?= =?us-ascii?q?dY3orHFc+IMscoUkLd9AR09cAbeeRU1vlVePa+6UzCXf9s9JGGjp8B5Gr9HuDi?= =?us-ascii?q?M/PVAYw5TTSUxzkUGj2zBH5BLpHTU24wuCRroN8RoZWTM6bpF21E/+wwvsjNj+?= =?us-ascii?q?luu6TnkwiWbvOJQOKi3dQR+6rmgBGq0Te0I5qb7xHMQEN23PTw4EZJNZl7PRcT?= =?us-ascii?q?S8qN7fQmOUeXghRFWd0PaRc97bZKH6XsMqJzkSAfWGEL/BGUx1uY9JCkgpwKSQ?= =?us-ascii?q?UnRACExgRcRmHg++k6KC6T+N2j4IiKtPqNcURoBlIzDzFA6N6GYrKW6XD6NtC2?= =?us-ascii?q?z09nNwIFvHbT8YcYCBkKhXNfxMJPU0YYLo7mPyAh3TjfXtfsl39mEadywA/1yQ?= =?us-ascii?q?rjOmraoqTIYTMFJ4ThEuG4HnI5SL/Dw1yCTBW8hLdmlrEuwMFtXmTtFouKYCF?=
IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AMXLbuq1J7Vhzi0nQfOnvWgqjBKckLtp133Aq?= =?us-ascii?q?2lEZdPWaSKylfqGV8cjzuiWbtN98YhodcJW7WZVoP0m3yXcF2+Us1N6ZNWHbUS?= =?us-ascii?q?mTXeNfBODZrAEIdReOldK1rZ0QFpRDNA=3D=3D?=
X-IronPort-AV: E=Sophos;i="5.88,223,1635199200"; d="scan'208,217";a="740672"
Received: from 249.28.30.93.rev.sfr.net (HELO smtpclient.apple) ([93.30.28.249]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2021 15:47:29 +0100
From: Karthik Bhargavan <karthikeyan.bhargavan@inria.fr>
Message-Id: <AE7E3C33-0281-4CF1-AE3F-CC7923E99E77@inria.fr>
Content-Type: multipart/alternative; boundary="Apple-Mail=_D9E82DF6-5D80-40D6-A43D-08A1C67F7473"
Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\))
Date: Tue, 21 Dec 2021 15:47:27 +0100
In-Reply-To: <42346e03-df57-57c1-c781-249ebe13e798@inria.fr>
Cc: Raphael Robert <ietf=40raphaelrobert.com@dmarc.ietf.org>, MLS List <mls@ietf.org>
To: =?utf-8?Q?Th=C3=A9ophile_Wallez?= <theophile.wallez@inria.fr>
References: <162040556024.10515.18434867074453969330@ietfa.amsl.com> <F94C2B20-DC04-4028-937E-698D598E319D@sn3rd.com> <81ED88F6-16A8-45C4-A9B9-FD6659CB68FB@sn3rd.com> <4614A3C1-8461-48F8-AD53-C1399BC5F673@sn3rd.com> <6B8101F5-A54A-429A-82B0-5386E321F525@inria.fr> <8E5EC435-7B97-4852-AB90-F4E501ACDEDA@raphaelrobert.com> <42346e03-df57-57c1-c781-249ebe13e798@inria.fr>
X-Mailer: Apple Mail (2.3693.20.0.1.32)
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/agouKtpPOwBtTIjvJa_sGBM-bmU>
Subject: Re: [MLS] Optimizing Unmerged Leaves (or: bringing the MLS tree size back to O(n))
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Dec 2021 14:47:36 -0000

--Apple-Mail=_D9E82DF6-5D80-40D6-A43D-08A1C67F7473
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello All,

Getting back to this suggestion from several months ago.
Recall that the issue is that the MLS tree size with explicit unmerged =
leaves can grow to O(N log N) and the suggestion in this thread would =
bring it down to O(N).

We worked the precise changes needed to the spec to achieve this and it =
can be done with a small change. The patch is attached.
The key observation is that unmerged leaves for each node can be =
recomputed if each node has an epoch timestamp.

In implementations, members may want to pre-compute and store the =
unmerged leaves lists just like in the current design,=20
and only use this compression proposal when creating Welcome messages.
However, as discussed in this thread and elsewhere, in practice the =
=E2=80=9Clog N=E2=80=9D factor does not appear to make much of an =
impact.

So, we are not proposing this as a PR at this time, and are attaching =
the patch only as reference, in case this size optimization becomes =
important in the future.

Best,
Karthik.


> On 21 Jun 2021, at 13:14, Th=C3=A9ophile Wallez =
<theophile.wallez@inria.fr> wrote:
>=20
> Hi and sorry for the late answer,
>=20
> I'll also respond inline:
>=20
> On 22/05/2021 12:14, Raphael Robert wrote:
>>=20
>>> On 21. May 2021, at 16:59, Karthik Bhargavan =
<karthikeyan.bhargavan@inria.fr <mailto:karthikeyan.bhargavan@inria.fr>> =
wrote:
>>>=20
>>> Solution 1
>>> =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
>>>=20
>>> One possibility, close to the current MLS spec would be to not store =
the unmerged leaf at a node if it is already stored at the parent.
>>> This way, every leaf is present at most once in some =
`unmerged_leaves` array.
>>> In the worst case, this uses 4*n + 4*(n/2) =3D 6*n bytes (4*n for =
the `unmerged_leaves` array size, 4*(n/2) because at most n/2 leaves are =
stored in the `unmerged_leaves` arrays).
>>> In the best case, this uses 4*n bytes.
>>> The tree resolution algorithm will now have to do a little more =
calculation to re-compute the unmerged leaves at each node.
>>=20
>>=20
>> This sounds rather straight forward on a logical level. It clearly =
reduces the stored/transmitted payload size, but it introduces a new =
cost: previously only O(log n) nodes needed to be modified during an =
Update/Remove. Now we might have to =E2=80=9Cpush down=E2=80=9D the book =
keeping information from parents to children, in the worst case this =
affects n/2 nodes, so the cost of modifying nodes goes up to O(n).
>> If we consider a very large group, there would be a measurable =
difference when clients load/store nodes from/to disk.
>> My current intuition is that currently I/O operations can be done in =
O(log n) with clever parent hash caching. The worst case here would be =
the following: A client is a member of a large group and has been =
offline for a while (which is not a far fetched scenario). The client =
now comes online and has to process a large number of handshake =
messages. For robustness, the client might be inclined to frequently =
persist the intermediary state. This is where the I/O cost kicks in.
>=20
> Indeed, when "pushing down" the unmerged leaves, if it is pushed down =
to a blank node, we might have to modify more than O(log n) nodes. This =
could be solved by storing unmerged leaves in blank nodes, but it is =
starting to get quite ugly.
>=20
>>> Solution 2+
>>> =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
>>>=20
>>> However, if we wish to compress further, we can do so as well, using =
two facts:
>>> - if a node `n` has two children `l` and `r`, then =
n.last_update_epoch is equal to either l.last_update_epoch or =
r.last_update_epoch,
>>> - if `l` is unmerged for some node then l.creation_epoch =3D =
l.last_update_epoch (because in this case, the leaf never generated an =
UpdatePath) (the converse is not true, for example in the case when its =
sibling generates an UpdatePath).
>>>=20
>>> So at each node, we can store the direction from which the node was =
last updated (for example with a boolean flag), then given any node `n` =
we can "follow the path" down the tree to obtain a leaf `l`, and we have =
n.last_update_epoch =3D l.last_update_epoch.
>>> Furthermore, we don't need to store the creation epoch for leaves:
>>> - if `l` is unmerged for `n`, then n.last_update_epoch < =
l.creation_epoch =3D l.last_update_epoch,
>>> - if `l` is not unmerged for `n`, then n.last_update_epoch >=3D =
l.last_update_epoch (because when `l` is updated, it updates all the =
nodes above it).
>>> This uses 8*n + 1*n =3D 9*n bytes for the whole tree.
>>=20
>> I didn=E2=80=99t check all the ramifications here tbh. I think it is =
similar to solution 1 in terms of increased I/O cost.
>=20
> Actually, there is no "pushing down" here, when modifying nodes on a =
path from leaf to the root, only those nodes are modified (we update the =
direction of the parent nodes in the path, and update the last update =
epoch of the leaf), so the I/O cost is actually O(log n).
>=20
> Thank you for your comments,
> Th=C3=A9ophile.
>=20
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls


--Apple-Mail=_D9E82DF6-5D80-40D6-A43D-08A1C67F7473
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_A7B467DE-692B-4B8A-BBE4-E428A5CADDE3"


--Apple-Mail=_A7B467DE-692B-4B8A-BBE4-E428A5CADDE3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div =
class=3D"">Hello All,</div><div class=3D""><br class=3D""></div>Getting =
back to this suggestion from several months ago.<div class=3D"">Recall =
that the issue is that the MLS tree size with explicit unmerged leaves =
can grow to O(N log N) and the suggestion in this thread would bring it =
down to O(N).</div><div class=3D""><br class=3D""></div><div class=3D"">We=
 worked the precise changes needed to the spec to achieve this and it =
can be done with a small change. The patch is attached.</div><div =
class=3D"">The key observation is that unmerged leaves for each node can =
be recomputed if each node has an epoch timestamp.</div><div =
class=3D""><br class=3D""></div><div class=3D"">In implementations, =
members may want to pre-compute and store the unmerged leaves lists just =
like in the current design,&nbsp;</div><div class=3D"">and only use this =
compression proposal when creating Welcome messages.</div><div =
class=3D"">However, as discussed in this thread and elsewhere, in =
practice the =E2=80=9Clog N=E2=80=9D factor does not appear to make much =
of an impact.</div><div class=3D""><br class=3D""></div><div =
class=3D"">So, we are not proposing this as a PR at this time, and are =
attaching the patch only as reference, in case this size optimization =
becomes important in the future.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Best,</div><div =
class=3D"">Karthik.</div><div class=3D""><br class=3D""></div><div =
class=3D""><div></div></div></body></html>=

--Apple-Mail=_A7B467DE-692B-4B8A-BBE4-E428A5CADDE3
Content-Disposition: attachment;
	filename=compact_unmerged_leaves.patch
Content-Type: application/octet-stream; x-unix-mode=0644;
 name="compact_unmerged_leaves.patch"
Content-Transfer-Encoding: 7bit

diff --git a/draft-ietf-mls-protocol.md b/draft-ietf-mls-protocol.md
index 00748ae..7126285 100644
--- a/draft-ietf-mls-protocol.md
+++ b/draft-ietf-mls-protocol.md
@@ -715,8 +715,7 @@ Each node in a ratchet tree contains up to five values:
 
 * A private key (only within the member's direct path, see below)
 * A public key
-* An ordered list of node indices for "unmerged" leaves (see
-  {{views}})
+* An epoch number indicating when the public key was last updated
 * A credential (only for leaf nodes)
 * A hash of certain information about the node's parent, as of the last time the
   node was changed (see {{parent-hash}}).
@@ -724,6 +723,10 @@ Each node in a ratchet tree contains up to five values:
 The conditions under which each of these values must or must not be
 present are laid out in {{views}}.
 
+We define the _unmerged leaves_ at a non-leaf node as the list of
+leaves under this node whose epoch number is strictly greater than the
+epoch number at the node.
+
 A node in the tree may also be _blank_, indicating that no value is present at
 that node.  The _resolution_ of a node is an ordered list of non-blank nodes
 that collectively cover all non-blank descendants of the node.  The resolution
@@ -958,7 +961,7 @@ The recipient of an UpdatePath processes it with the following steps:
 2. Merge the updated path secrets into the tree.
    * For all updated nodes,
      * Replace the public key for each node with the received public key.
-     * Set the list of unmerged leaves to the empty list.
+     * Set the epoch number to the epoch number of the Commit
      * Store the updated hash of the node's parent (represented as a ParentNode
        struct), going from root to leaf, so that each hash incorporates all the
        nodes above it. The root node always has a zero-length hash for this
@@ -1336,12 +1339,18 @@ struct {
 ~~~~~
 
 The tree hash of a leaf node is the hash of leaf's `LeafNodeHashInput` object which
-might include a Key Package depending on whether or not it is blank.
+might include a `LeafNode` object depending on whether or not it is blank. Each non-empty
+`LeafNode` contains a key package and an epoch indicating when the leaf was last modified.
 
 ~~~~~
+struct {
+    KeyPackage key_package;
+    uint64 epoch;
+} LeafNode;
+
 struct {
     uint32 node_index;
-    optional<KeyPackage> key_package;
+    optional<LeafNode> leaf_node;
 } LeafNodeHashInput;
 ~~~~~
 
@@ -1353,7 +1362,7 @@ object depending on whether the node is blank or not.
 struct {
     HPKEPublicKey public_key;
     opaque parent_hash<0..255>;
-    uint32 unmerged_leaves<0..2^32-1>;
+    uint64 epoch;
 } ParentNode;
 
 struct {
@@ -2432,12 +2441,9 @@ the right, etc.
 * If necessary, extend the tree to the right until it has at least index + 1
   leaves
 
-* For each non-blank intermediate node along the path from the leaf at position
-  `index` to the root, add `index` to the `unmerged_leaves` list for the node.
-
 * Set the leaf node in the tree at position `index` to a new node containing the
-  public key from the KeyPackage in the Add, as well as the credential under
-  which the KeyPackage was signed
+  public key from the KeyPackage in the Add, the epoch number of the Commit,
+  and the credential under which the KeyPackage was signed.
 
 ### Update
 
@@ -3255,7 +3261,7 @@ enum {
 struct {
     NodeType node_type;
     select (Node.node_type) {
-        case leaf:   KeyPackage key_package;
+        case leaf:   LeafNode leaf_node;
         case parent: ParentNode node;
     };
 } Node;

--Apple-Mail=_A7B467DE-692B-4B8A-BBE4-E428A5CADDE3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 21 Jun 2021, at 13:14, Th=C3=A9ophile Wallez &lt;<a =
href=3D"mailto:theophile.wallez@inria.fr" =
class=3D"">theophile.wallez@inria.fr</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D"">
 =20
    <meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3DUTF-8" class=3D"">
 =20
  <div class=3D""><p class=3D"">Hi and sorry for the late answer,<br =
class=3D"">
      <br class=3D"">
      I'll also respond inline:<br class=3D"">
    </p>
    <div class=3D"moz-cite-prefix">On 22/05/2021 12:14, Raphael Robert
      wrote:<br class=3D"">
    </div>
    <blockquote type=3D"cite" =
cite=3D"mid:8E5EC435-7B97-4852-AB90-F4E501ACDEDA@raphaelrobert.com" =
class=3D""><br class=3D"">
      <div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space;
        line-break: after-white-space;" class=3D"">
        <div class=3D"">
          <div class=3D"">
            <blockquote type=3D"cite" class=3D"">
              <div class=3D"">On 21. May 2021, at 16:59, Karthik =
Bhargavan
                &lt;<a href=3D"mailto:karthikeyan.bhargavan@inria.fr" =
class=3D"" moz-do-not-send=3D"true">karthikeyan.bhargavan@inria.fr</a>&gt;=

                wrote:</div>
              <div style=3D"word-wrap: break-word; -webkit-nbsp-mode:
                space; line-break: after-white-space;" class=3D"">
                <meta http-equiv=3D"Content-Type" content=3D"text/html;
                  charset=3DUTF-8" class=3D"">
                <div class=3D"" style=3D"caret-color: rgb(0, 0, 0);"><br =
class=3D"">
                </div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">Solution
                  1</div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, =
0);">=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94</div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, 0);"><br =
class=3D"">
                </div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, 0);">One
                  possibility, close to the current MLS spec would be to
                  not store the unmerged leaf at a node if it is already
                  stored at the parent.</div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, =
0);"><span class=3D"">This way, every leaf is present at most
                    once in some `unmerged_leaves` array.</span><br =
class=3D"">
                  <span class=3D"">In the worst case, this uses 4*n +
                    4*(n/2) =3D 6*n bytes (4*n for the `unmerged_leaves`
                    array size, 4*(n/2) because at most n/2 leaves are
                    stored in the `unmerged_leaves` =
arrays).</span></div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, =
0);"><span class=3D"">In the best case, this uses 4*n =
bytes.</span></div>
                <div class=3D"" style=3D"caret-color: rgb(0, 0, =
0);"><span class=3D"">The tree resolution algorithm will now have
                    to do a little more calculation to re-compute the
                    unmerged leaves at each node.</span></div>
              </div>
            </blockquote>
          </div>
          <div class=3D"">
            <div class=3D""><br class=3D"">
            </div>
            This sounds rather straight forward on a logical level. It
            clearly reduces the stored/transmitted payload size, but it
            introduces a new cost: previously only O(log n) nodes needed
            to be modified during an Update/Remove. Now we might have to
            =E2=80=9Cpush down=E2=80=9D the book keeping information =
from parents to
            children, in the worst case this affects n/2 nodes, so the
            cost of modifying nodes goes up to O(n).</div>
          <div class=3D"">If we consider a very large group, there would
            be a measurable difference when clients load/store nodes
            from/to disk.</div>
          <div class=3D"">My current intuition is that currently I/O
            operations can be done in O(log n) with clever parent hash
            caching. The worst case here would be the following: A
            client is a member of a large group and has been offline for
            a while (which is not a far fetched scenario). The client
            now comes online and has to process a large number of
            handshake messages. For robustness, the client might be
            inclined to frequently persist the intermediary state. This
            is where the I/O cost kicks in.<br class=3D"">
          </div>
        </div>
      </div>
    </blockquote>
    <br class=3D"">
    Indeed, when "pushing down" the unmerged leaves, if it is pushed
    down to a blank node, we might have to modify more than O(log n)
    nodes. This could be solved by storing unmerged leaves in blank
    nodes, but it is starting to get quite ugly.<br class=3D"">
    <br class=3D"">
    <blockquote type=3D"cite" =
cite=3D"mid:8E5EC435-7B97-4852-AB90-F4E501ACDEDA@raphaelrobert.com" =
class=3D"">
      <div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space;
        line-break: after-white-space;" class=3D"">
        <div class=3D"">
          <div class=3D"">
            <blockquote type=3D"cite" class=3D"">
              <div class=3D"">
                <div style=3D"word-wrap: break-word; -webkit-nbsp-mode:
                  space; line-break: after-white-space;" class=3D"">
                  <div class=3D"" style=3D"caret-color: rgb(0, 0, 0);">
                    <div class=3D"">
                      <div class=3D""><font class=3D"">Solution =
2+</font></div>
                      <div class=3D""><font =
class=3D"">=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94</font></div>
                      <div class=3D""><font class=3D""><br class=3D"">
                        </font></div>
                    </div>
                    <div class=3D"">However, if we wish to compress
                      further, we can do so as well,&nbsp;<span =
class=3D"">using
                        two facts:</span></div>
                    <div class=3D""><span class=3D"">- if a node `n` has =
two
                        children `l` and `r`, then n.last_update_epoch
                        is equal to either l.last_update_epoch or
                        r.last_update_epoch,</span><br class=3D"">
                      <span class=3D"">- if `l` is unmerged for some =
node
                        then l.creation_epoch =3D l.last_update_epoch
                        (because in this case, the leaf never generated
                        an UpdatePath) (the converse is not true, for
                        example in the case when its sibling generates
                        an UpdatePath).</span></div>
                    <div class=3D""><br class=3D"">
                      <span class=3D"">So at each node, we can store the
                        direction from which the node was last updated
                        (for example with a boolean flag), then given
                        any node `n` we can "follow the path" down the
                        tree to obtain a leaf `l`, and we have
                        n.last_update_epoch =3D =
l.last_update_epoch.</span><br class=3D"">
                      <span class=3D"">Furthermore, we don't need to =
store
                        the creation epoch for leaves:</span><br =
class=3D"">
                      <span class=3D"">- if `l` is unmerged for `n`, =
then
                        n.last_update_epoch &lt; l.creation_epoch =3D
                        l.last_update_epoch,</span><br class=3D"">
                      <span class=3D"">- if `l` is not unmerged for `n`,
                        then n.last_update_epoch &gt;=3D
                        l.last_update_epoch (because when `l` is
                        updated, it updates all the nodes above =
it).</span><br class=3D"">
                      <span class=3D"">This uses 8*n + 1*n =3D 9*n bytes =
for
                        the whole tree.</span></div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div class=3D""><br class=3D"">
            </div>
            I didn=E2=80=99t check all the ramifications here tbh. I =
think it is
            similar to solution 1 in terms of increased I/O cost.</div>
        </div>
      </div>
    </blockquote>
    <br class=3D"">
    Actually, there is no "pushing down" here, when modifying nodes on a
    path from leaf to the root, only those nodes are modified (we update
    the direction of the parent nodes in the path, and update the last
    update epoch of the leaf), so the I/O cost is actually O(log n).<br =
class=3D"">
    <br class=3D"">
    Thank you for your comments,<br class=3D"">
    Th=C3=A9ophile.<br class=3D"">
    <br class=3D"">
  </div>

_______________________________________________<br class=3D"">MLS =
mailing list<br class=3D""><a href=3D"mailto:MLS@ietf.org" =
class=3D"">MLS@ietf.org</a><br =
class=3D"">https://www.ietf.org/mailman/listinfo/mls<br =
class=3D""></div></blockquote></div><br class=3D""></div></body></html>=

--Apple-Mail=_A7B467DE-692B-4B8A-BBE4-E428A5CADDE3--

--Apple-Mail=_D9E82DF6-5D80-40D6-A43D-08A1C67F7473--

