Re: [TLS] PR#28: Converting cTLS to QUIC-style varints

Eric Rescorla <ekr@rtfm.com> Sun, 15 November 2020 20:14 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EC34D3A09EB for <tls@ietfa.amsl.com>; Sun, 15 Nov 2020 12:14:00 -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=rtfm-com.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 F_nTRxQEWt51 for <tls@ietfa.amsl.com>; Sun, 15 Nov 2020 12:13:59 -0800 (PST)
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (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 AF15B3A09E7 for <tls@ietf.org>; Sun, 15 Nov 2020 12:13:58 -0800 (PST)
Received: by mail-lj1-x230.google.com with SMTP id o24so17603656ljj.6 for <tls@ietf.org>; Sun, 15 Nov 2020 12:13:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+PvJk9LGoxW9L4bq8scO7CCZ1Tjb6SK6bLj6+dvNYYE=; b=BCoQLinptqAVys+rGDTLlnJzGaL0m++PrPvUyKius8LWCKXNgQr1ugRPdjU4o8FgS3 0Kjx6lXyRuXeLgahRV4sJMHmHO+DYWMMYBhx08FdLFxEakHEFOjBFivB0eyW2WnVIkTB +ktravuBGS6CHvHRsr0be9tJK535CqIZhCuQe4oQOREBa0ltu6wBs6OHEi69bFGXYO8K psmCQKKf1JJ9791Y8maHpm6s/UtCTOPQPSfd4pWeOMGYHBpwkaLa+5F3BUZXH0nSFkEb /vbUIiehu4jjK3dIPzCbqHJdGAEQWCYarAqP4asA0LUv937dKtlOthM0mvtRR4F7YBQg ZQ1Q==
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=+PvJk9LGoxW9L4bq8scO7CCZ1Tjb6SK6bLj6+dvNYYE=; b=YVwNJhWxgToFkEOT8JcjqrWwO+eukrAzLrwBxYloUoyuPsMPsa0EglBOVmDCwwITTV rr9jBLVez0s4FAcJ+iz4B7yCjsydtiHi1xki0FsKibPEu8OexaFpugF1iN5336x0vCrw EeEXTjfl9St6c6WlCZa7IWm8DcjSTG6Xi/qPqY9SBFYmgZ8inyvMY9FRmNQTFoSrYxnP mucecR9u1gVVxkxSceylk+xyROVxqK31OesoNoy4SPN4LBtsWEm8fluShz/DIAoghALC CIo97z9V4BzqnpkLRyyXAc6le1XvYVDP/2l/37X/VkyjEBM9GE1vjl1o3c5vC7Emn4/Y laWg==
X-Gm-Message-State: AOAM530TFnCFXbPfoc1MoL7WgyuxmYQPqOTW9Qd0MfuKFHmnrEyMFDjZ 9/+3jbnWA+eSVKkh2y1WrAt63Wy831c3ZqXs2Sbllw==
X-Google-Smtp-Source: ABdhPJyu3yqp+5U0M5nn9HK36UwSzE7nOyhRaTE/CmMm6Wq+Dt5dp0MCT1tzYDdLNQgDTX8/TeR9yLKTo1WdYMTSLlw=
X-Received: by 2002:a05:651c:1105:: with SMTP id d5mr5417144ljo.265.1605471236971; Sun, 15 Nov 2020 12:13:56 -0800 (PST)
MIME-Version: 1.0
References: <CABcZeBPNFhGoLhgqeR9ObwyU68BYq=hXG1PhXcqNsNDNFGGyaw@mail.gmail.com> <CAOYVs2rEDtgJFVpiQkcaaYG2LAyW1hB5Cou4kUoG2_dkxMFTww@mail.gmail.com> <CABcZeBP3BUDEeiV2T-kxYTmC841XE_BrXhPHSoRqfdH0hHd-6w@mail.gmail.com> <BBA456AB-EC42-47DD-A3E3-5FC0E9E7A534@akamai.com> <CAOYVs2r+AiEs0q6sybqT2CbtLtj4KE4onr-3qjr5vZ5RFPiKOQ@mail.gmail.com> <CABcZeBNQ3tk-rGpdJ88q0oaUXXq4B7NQWKp8P8uQOyxA7Lwstg@mail.gmail.com> <CACdeXi+xOTA7m9fAQzbrDRXA+B3iwB3-0dc7K1+QVbyvaueMQg@mail.gmail.com>
In-Reply-To: <CACdeXi+xOTA7m9fAQzbrDRXA+B3iwB3-0dc7K1+QVbyvaueMQg@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Sun, 15 Nov 2020 12:13:20 -0800
Message-ID: <CABcZeBPrtt5CNQrJfZD-3uCqG8uUe8bzzQJjwZvnz5yHh8MMDQ@mail.gmail.com>
To: Nick Harper <nharper@google.com>
Cc: Marten Seemann <martenseemann@gmail.com>, "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000c6f05f05b42ae6f0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/2STGDGRBnvPcct6qF0lYjj0UT_I>
Subject: Re: [TLS] PR#28: Converting cTLS to QUIC-style varints
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Nov 2020 20:14:01 -0000

Trying to close out this discussion, it seems to me like there are three
major options:

1. The current scheme
2. The current scheme with a deterministic minimal encoding (e.g., the two
byte version is offset by 127)
3. The QUIC scheme

I don't think that the QUIC scheme with deterministic encoding makes sense,
because the virtue of the QUIC scheme is commonality with something already
defined. I'm hearing that people are not as excited about moving to QUIC as
I had expected and to the best of my knowledge, there is no valid reason to
encode to > 2^32-1 in TLS. I also don't think using encoding (1) but
mandating minimal length makes sense, as it's just as easy to do a
deterministic minimal encoding.

As Christian observes it *is* significantly more painful to do (2): the
conventional way to encode vectors in TLS with minimal copying is:

- Mark your current place --> X
- Skip forward the length of the length field --> L
- Encode the value
- Encode (current position - (X + L)) at X

But this won't be possible in (2). As MT observes, if you think of this as
a two-pass system, there is not as much of a problem here [though not
necessarily no problem]. Also, if you use a separate buffer, there is no
problem. As noted above by MT and others, cTLS expands the transcript and
so having a deterministic compression scheme is perhaps not as important,
given that decompression is deterministic, but it still seems nice to have.

Given the above, I think my preference would be (1) or (2), with, I think,
a slight preference for (2).

-Ekr









On Tue, Oct 6, 2020 at 5:33 PM Nick Harper <nharper@google.com> wrote:

> I have no strong opinion on how this is formatted. I'd base my decision on
> what the maximum value cTLS needs to encode: If 2^22-1 is sufficient, let's
> keep it as is, otherwise let's change it to the QUIC format (or some other
> change to increase the max value). I do like that the existing scheme,
> compared to QUIC varints, is more efficient for values 64-127 and just as
> efficient for the rest.
>
> On Mon, Oct 5, 2020 at 8:09 PM Eric Rescorla <ekr@rtfm.com> wrote:
>
>> I don't have a strong opinion on whether to require a minimal encoding,
>> but if we're not going to use QUIC's encoding as-is, then I would rather
>> stick with the existing scheme, which has twice as large a range for the 1
>> byte encoding and is thus more compact for a range of common cases.
>>
>> -Ekr
>>
>>
>> On Mon, Oct 5, 2020 at 7:31 PM Marten Seemann <martenseemann@gmail.com>
>> wrote:
>>
>>> In that case, why use QUIC's encoding at all? It would just put the
>>> burden on the receiver to check that the minimal encoding was used.
>>> Would it instead make more sense to modify QUIC's encoding, such that
>>> the 2-byte encoding doesn't encode the numbers from 0 to 16383, but the
>>> numbers from 64 to (16383 + 64), and equivalently for 4 and 8-byte
>>> encodings?
>>>
>>> On Tue, Oct 6, 2020 at 9:22 AM Salz, Rich <rsalz@akamai.com> wrote:
>>>
>>>> Can you just say “QUIC rules but use the minimum possible length”?
>>>>
>>> _______________________________________________
>> TLS mailing list
>> TLS@ietf.org
>> https://www.ietf.org/mailman/listinfo/tls
>>
>