Re: [TLS] Point Compression

Andrey Jivsov <crypto@brainhub.org> Wed, 27 October 2021 02:37 UTC

Return-Path: <andrey@brainhub.org>
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 F1ECA3A0821 for <tls@ietfa.amsl.com>; Tue, 26 Oct 2021 19:37:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-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 xgKRP0ouZXfg for <tls@ietfa.amsl.com>; Tue, 26 Oct 2021 19:37:47 -0700 (PDT)
Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 B41DE3A074B for <tls@ietf.org>; Tue, 26 Oct 2021 19:37:46 -0700 (PDT)
Received: by mail-yb1-f177.google.com with SMTP id o12so2664749ybk.1 for <tls@ietf.org>; Tue, 26 Oct 2021 19:37:46 -0700 (PDT)
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=UsnuHEvRL7i5APZbtJIWQztzECtxMn2tRZyhgVOhvjE=; b=D3YXENcknxfzIk+zrR2DDj/qWNZzxVE7+BAbwmvfi64C9Qs+mdrX5Z0pVG/BxdoF5c aPE60FHs0kLxHS8aQ1F3hZY47eHi8yAdiQ+yCdT6mtchE388p/zGjBmjMh4f/zzThifu 5IONNqKY7lo24TxsLuFXPlOvc1bNmTdFnquOGAMMU8bagF8gTBi4+nRdd3+sLTKuzR1l 6tar2WEu32JS2+Gi8Wl0AHL4f+op+J7SGgGMOHCxA1k9mSX9t0RudG7yxfuHZYXdAtu/ BbcLhNb+flH9S1IdBTf3+DEDBDCgSA99PgcTNOnlJy9cImYdht0ZbvY/RIEZJDHCauT+ B1Qg==
X-Gm-Message-State: AOAM530lBmIKCvBT8oztTbOAcGrElw6E5syRiQBpKMkawggms29MbZIo GoF8dv8OvZsry4qeR4mMLs39kbsnT2/H04WTsqS1mQ==
X-Google-Smtp-Source: ABdhPJxeN1vFAIVHVDs16+Sk5U3yyk5aS+5JXTZ8NNo0tBhEhyEVRZ6pLVZC91JrS1f4sAyqM5O4t1y5NMIK5eDDvwM=
X-Received: by 2002:a25:4210:: with SMTP id p16mr29151315yba.242.1635302266111; Tue, 26 Oct 2021 19:37:46 -0700 (PDT)
MIME-Version: 1.0
References: <CAEa9xj7Rrjps2QGr1x-aGmboU64ou+fhjJ4HW7aCYMPXPseXaA@mail.gmail.com> <CAKUk3bso3b-kFtLtR-S9bz9j6s366LXQs9-J17k_HrwL46ZgKQ@mail.gmail.com> <CAEa9xj5v6mupFDSr3wWwteh1TY4p1E4L_1eWBntMKO0jgQtgaw@mail.gmail.com> <CAKUk3bt5ALPeCgHo6gr4bRKEaD+i8jmEP_2iCkMrULDowYdNTw@mail.gmail.com> <HE1PR0701MB30508D2A018DDCC7127F830989849@HE1PR0701MB3050.eurprd07.prod.outlook.com>
In-Reply-To: <HE1PR0701MB30508D2A018DDCC7127F830989849@HE1PR0701MB3050.eurprd07.prod.outlook.com>
From: Andrey Jivsov <crypto@brainhub.org>
Date: Tue, 26 Oct 2021 19:37:35 -0700
Message-ID: <CAKUk3bvHSPLtmTZaJ44MBKiyg-nWyY7rgfsyWDikGpzGo20vGA@mail.gmail.com>
To: John Mattsson <john.mattsson@ericsson.com>
Cc: Carl Mehner <c@cem.me>, IETF TLS <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000ac252c05cf4c7a12"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/9f5CCCAksexcvJ5JuPsBOcvigpw>
Subject: Re: [TLS] Point Compression
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: Wed, 27 Oct 2021 02:37:57 -0000

Looking closer, all what we discuss here is related to ECDH, so the sign of
a point is not important for the result.

In this case the compression can be a simple truncation to <x>, e.g.
without the need to do tricks with the private key to make this an
unambiguous representation of a point. This simple truncation works with
existing software. I think that TLS should adopt the <x> format (without 02
or 03 prefix).

Note that this truncation extends to the SEC1 compressed format: in this
case we just drop the first byte.

This truncation is highest-performance option and it's simplest too.

On Tue, Oct 26, 2021 at 12:58 AM John Mattsson <john.mattsson@ericsson.com>
wrote:

> There are several active documents also defining compact representation.
>
>
>
> After the discussion regarding HPKE there was a suggestion EDHOC should
> define a compract format that could be reused by other protocols. That was
> done in an Appendix.
>
> https://datatracker.ietf.org/doc/html/draft-ietf-lake-edhoc-12#page-67
>
>
>
> Also as an outcome of the HPKE discussions Dan Harkins has written on
> compact representation for HPKE submitted to CFRG. This also defines a a
> general format than can be reused by other protocols.
>
> https://datatracker.ietf.org/doc/draft-harkins-cfrg-dnhpke/
>
>
>
> > the support for 'regular' (SEC1) compressed curves is more widespread.
>
>
>
> What is support in this case? An implementation can just use one of the
> values "02" and "03" or flip a coin. If you have support of 'regular'
> (SEC1) compressed curves, then compact representation is trivial.
>
>
>
> Cheers,
>
> John
>
>
>
> *From: *TLS <tls-bounces@ietf.org> on behalf of Andrey Jivsov <
> crypto@brainhub.org>
> *Date: *Tuesday, 26 October 2021 at 07:15
> *To: *Carl Mehner <c@cem.me>
> *Cc: *IETF TLS <tls@ietf.org>
> *Subject: *Re: [TLS] Point Compression
>
> Do we have evidence that "02 <x>" or "03 <x>" is more widespread than <x>
> for NIST curves? I haven't seen "02 <x>" or "03 <x>" in deployed products
> in TLS / X.509 at all. So, I feel that for TLS space the slate is clean
> regarding compression. X25519 uses one coordinate, which is simiiar to
> doing <x> for NIST curves...
>