Re: [jose] [COSE] COSE/JOSE elliptic curves and their relationship with key types

Ilari Liusvaara <ilariliusvaara@welho.com> Tue, 13 July 2021 11:12 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 216693A13FA; Tue, 13 Jul 2021 04:12:57 -0700 (PDT)
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, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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 FYJuyOaOlRUl; Tue, 13 Jul 2021 04:12:54 -0700 (PDT)
Received: from welho-filter2.welho.com (welho-filter2b.welho.com [83.102.41.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4E9483A13F9; Tue, 13 Jul 2021 04:12:53 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter2.welho.com (Postfix) with ESMTP id 5BC7DC3F1B; Tue, 13 Jul 2021 14:12:51 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp2.welho.com ([IPv6:::ffff:83.102.41.85]) by localhost (welho-filter2.welho.com [::ffff:83.102.41.24]) (amavisd-new, port 10024) with ESMTP id o3A-BwgI0qc3; Tue, 13 Jul 2021 14:12:51 +0300 (EEST)
Received: from LK-Perkele-VII2 (87-92-216-160.rev.dnainternet.fi [87.92.216.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp2.welho.com (Postfix) with ESMTPSA id 1B56B72; Tue, 13 Jul 2021 14:12:48 +0300 (EEST)
Date: Tue, 13 Jul 2021 14:12:47 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Benjamin Kaduk <kaduk@mit.edu>
Cc: jose@ietf.org, cose@ietf.org
Message-ID: <YO11Lx4PLtfCCz9B@LK-Perkele-VII2.locald>
References: <20210707212059.GX17170@mit.edu> <21116.1625697755@localhost> <20210713034600.GJ17170@mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <20210713034600.GJ17170@mit.edu>
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/1Fo2wGarjTpAJTZ4JN-hlJ9tTwc>
Subject: Re: [jose] [COSE] COSE/JOSE elliptic curves and their relationship with key types
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jul 2021 11:12:57 -0000

On Mon, Jul 12, 2021 at 08:46:00PM -0700, Benjamin Kaduk wrote:
> Hi Michael,
> 
> Thanks for sharing your thoughts.
> 
> On Wed, Jul 07, 2021 at 06:42:35PM -0400, Michael Richardson wrote:
> > 
> > Benjamin Kaduk <kaduk@mit.edu> wrote:
> >     > As written, that seems to allow a notion of "consistent" that is not
> >     > strictly 1:1, but all of the curves defined so far only have that 1:1
> >     > mapping, and trying to use any other "kty" for an existing curve would run
> >     > into interop problems with existing implementations that reject other "kty"
> >     > values for that curve.
> > 
> > It seems to me that we think it's always gonna be 1:1, but that we admit that
> > we can't predict the future, and so we are providing some extra rope.
> 
> There is of course a reason that I am asking the question.  I had hoped
> to separate the initial batch of responses to the general question from the
> specific case, so I didn't mention it in the initial note, but
> draft-ietf-lwig-curve-representations registers the Wei25519 and Wei448
> elliptic curves (the short-Weierstrass analogues of Curve25519 and
> Curve448), and currently lists the key type for both as "EC2 or OKP".

To my knowledge, the goals of those curves are:

- Be compatible with devices with arbitrary-curve short-Weierstrass
  acceleration.
- Be compatible with legacy EC algorithms (e.g., ECDH, ECDSA). However,
  there are some nasty edge cases here.
- Use more efficient base fields and ladders where acceleration is not
  available.

> To my knowledge, these curve (representation)s are not in wide use and
> there is thus not a well-established single point representation to use
> with them.  However, since the intent of the work is to expose the CFRG
> curves' benefits to implementations tailored to short-Weierstrass curves,
> which in turn would be likely to use the "EC2" representation in its
> interfaces, it seems like if we were to pick a preferred representation it
> would be "EC2".

There is well-established encoding for short-Weierstrass curves to bytes:
the secg encoding (there are both compressed and uncompressed variants).
However, These curves are intended to be worked with general-purpose
short-Weierstras implemenations, and COSE EC2 (and JOSE EC) are intended
for the same class, so EC2 is the correct choice, and allowing both
would just add more code.


-Ilari