Re: [MLS] RT array implementation motivation

Richard Barnes <rlb@ipv.sx> Wed, 19 May 2021 13:25 UTC

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 3CB9E3A0E72 for <mls@ietfa.amsl.com>; Wed, 19 May 2021 06:25:16 -0700 (PDT)
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.20150623.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 w3ivWbphhssC for <mls@ietfa.amsl.com>; Wed, 19 May 2021 06:25:11 -0700 (PDT)
Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 B25113A0E74 for <mls@ietf.org>; Wed, 19 May 2021 06:25:11 -0700 (PDT)
Received: by mail-qt1-x834.google.com with SMTP id k19so10069312qta.2 for <mls@ietf.org>; Wed, 19 May 2021 06:25:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BpImCsU5Sh+NiP9yYeht6AMarYLGhgm7liKYwGCpv2Y=; b=Q2lnaaWiOLx2FfIc5dMlKOVFXCH4vhSx5sVz4v1O64RTz50B/dOjNH2N0uieCeuRx4 5g29OiRoJObpjxyC24ahAfDz0EpfD2bGo6dT2syqyH6m5Bi+vDtS1k5vMSuS0QstIGAX yKdxkJbMhU1sBvzxhxEytvpI6leldYQuwpzfk9+NoxqOjtrwBgQJsIKNpcxMcGl4DV/f 1uwb5iRBBG73piBSmz+pY5Vfatp9lzJMvlaG7gkfqTWU82bZyR3R8/JqpFzsv1xQmpJk zd4gPMz2YRtGtTfZbZYStwyqlkV5hlCn3yGyRL+0Tb/7Bs2PRIFaIN51fogmUqt8LYCx zEJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BpImCsU5Sh+NiP9yYeht6AMarYLGhgm7liKYwGCpv2Y=; b=mJTsZ5rw5vSGzEmZMPdbWjmY4jJM/0762JJP/rlXyqR5RJouVrDXUVTXIaWR0x1u3l 5vpXjiFh8J84bLJjJUlwKKqAIXxuQ90ehmfYqqBHmd35yj4H18E5ayhGiUidYdLfW8Y1 i3Yn8ACi+BI1wqganFHbRX5UjyzYtav2Tx7E/pP0AS+dF2MzwtO9ArQb6NPVwC5Dq1K3 nIFsMyOKkysl7R0P8cu3BJlvoUbBC39+iXT6lz12NfcPitS/RQLbgFD4mFpFE1uBuX1V iM4rPEUtiNyuvA3gc8M9i4y74i0M3FUzuuisFRR8VloVVK6N7ejX2tKengk0Il8wQMlh 5+Rw==
X-Gm-Message-State: AOAM531PLRR02ctqEQ4koEAee39wqgSfH5fVzBLVaJU/+ClTeIYtA//3 cCktLb54ZFIsqhJ85L3ropY9uILsefyQO9GkrKqXct9TWI155w==
X-Google-Smtp-Source: ABdhPJwHTZPE9r3ouZYln7l33N6cH9512eUz4C6KoUp26j3bKkh2394rzUVtDSAYtpah5Ol8ZJK7KmoFFahDi03Z6bM=
X-Received: by 2002:ac8:574e:: with SMTP id 14mr11262313qtx.191.1621430710235; Wed, 19 May 2021 06:25:10 -0700 (PDT)
MIME-Version: 1.0
References: <CAHvbzjKTFFAp-V_o_Gs-vqiT=6Zh1qXim6E0096t3or8UcrJ-g@mail.gmail.com>
In-Reply-To: <CAHvbzjKTFFAp-V_o_Gs-vqiT=6Zh1qXim6E0096t3or8UcrJ-g@mail.gmail.com>
From: Richard Barnes <rlb@ipv.sx>
Date: Wed, 19 May 2021 09:24:59 -0400
Message-ID: <CAL02cgRCh+XF23p7r4E=_aGjTU3HymO8EGFVhJPc4vjT4wTZhQ@mail.gmail.com>
To: Tijana Klimovic <tijana.klimovic97@gmail.com>
Cc: Messaging Layer Security WG <mls@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000083092005c2aec1c0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/bDhXBZVVuuOyhP0efe_gpHBTtlw>
Subject: Re: [MLS] RT array implementation motivation
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: Wed, 19 May 2021 13:25:16 -0000

Hi Tijana,

The specification doesn't require that the tree be implemented in a given
way.  Implementations are free to arrange their memory however they like.
The array notation just gives us a simple way to assign each node in the
tree an index.

--Richard

On Wed, May 19, 2021 at 8:56 AM Tijana Klimovic <tijana.klimovic97@gmail.com>
wrote:

> Hello,
>
> I have only recently started to look into the MLS specification, and was
> wondering why the ratchet tree (RT) structure is chosen to be implemented
> with an array. From what I understand, the pointer-based tree where each
> node would contain the following information:
>
>         struct {
>         Node* sibling;
>         Node* parent;
>         Node* left_child;
>         Node* right_child;
>         Optional<HPKEPublicEncKey> hpke_enc_pk;
>         Optional<HPKESecretEncKey> hpke_enc_sk;
>         Optional<Credential> credential;
>         Optional<vector<byte>> parent_hash;
>         Optional<vector<Node*>> unmerged_leaves;
>         } Node
>
> would be more efficient than an array w.r.t. all operations supported by
> the RT.
>
> Many thanks.
> Tijana
> _______________________________________________
> MLS mailing list
> MLS@ietf.org
> https://www.ietf.org/mailman/listinfo/mls
>