Re: [COSE] IANA COSE assignments

Ilari Liusvaara <ilariliusvaara@welho.com> Thu, 28 January 2021 17:37 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 92B883A166F for <cose@ietfa.amsl.com>; Thu, 28 Jan 2021 09:37:10 -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, 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 ObaOdqz7RsAX for <cose@ietfa.amsl.com>; Thu, 28 Jan 2021 09:37:08 -0800 (PST)
Received: from welho-filter4.welho.com (welho-filter4b.welho.com [83.102.41.30]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5085F3A166D for <cose@ietf.org>; Thu, 28 Jan 2021 09:37:07 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by welho-filter4.welho.com (Postfix) with ESMTP id CD38869DFD; Thu, 28 Jan 2021 19:37:05 +0200 (EET)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter4.welho.com [::ffff:83.102.41.26]) (amavisd-new, port 10024) with ESMTP id hKTJshFWm8Fd; Thu, 28 Jan 2021 19:37:05 +0200 (EET)
Received: from LK-Perkele-VII (84-253-225-235.bb.dnainternet.fi [84.253.225.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPSA id 84B142315; Thu, 28 Jan 2021 19:37:03 +0200 (EET)
Date: Thu, 28 Jan 2021 19:37:03 +0200
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Göran Selander <goran.selander@ericsson.com>
Cc: cose <cose@ietf.org>
Message-ID: <YBL2P89oGzPBARX6@LK-Perkele-VII>
References: <41F03211-E3F5-493B-AC94-0F9DA26A1D9F@ericsson.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <41F03211-E3F5-493B-AC94-0F9DA26A1D9F@ericsson.com>
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/4PIPilQY8a985StsFeft0No0-YI>
Subject: Re: [COSE] IANA COSE assignments
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jan 2021 17:37:11 -0000

On Thu, Jan 28, 2021 at 09:17:56AM +0000, Göran Selander wrote:
>  
> Hi all,
> 
> I'm one of the designated experts for the IANA registry of COSE
> algorithms and I need some guidance from the WG.
> 
> 1. Current IANA assignments and instructions for COSE algorithms [1]
> intentionally bundles certain parameters whereas others are not
> bundled.
> 
> For example, all COSE registrations of ECDH include key derivation,
> but ECDH algorithm and elliptic curve are not bundled. Section 6.3.1.
> states:

Here, things get bit more complicated with Wei25519/Wei448.

These curves have h!=1 (unlike every past elliptic curve in COSE, which
all have h=1), so it makes sense to multiply at the end by h in order
to guard for attacks with small subgroups ("co-factor ECDH").

However, RFC8152 defers to RFC6090 for ECDH, and RFC6090 assumes that
h=1. However, RFC8152 also species the output encoding per curve, so
one could specify special output encoding that multiplies by h before
encoding in order to take h into account. This should give co-factor
ECDH on the new curves without defining any new algorithms.

> As another example, ECDSA is bundled with a hash function (see table
> 1) but not  with the elliptic curve, see Section 2.1:
 
This is the way ECDSA is traditionally done in specifications.

For ease of correct implementation, one wants as little information
associated with the message (ideally none) that can contradict the
information in the key. JOSE is well-known for vulnerabilities arising
from implementations using information from message over information
from the key. And then some folks misdiagnosed this as problem with
algorithm agility.

The most well-known protocol to not do things the traditional way is
TLS 1.3. However, I think this is in order to simplify negotiation,
which is not appliciable to COSE. It definitely does not make
implementations easier (many implementations probably do not check
proper curve matching, which fortunately does not cause security
issues).


The new curves might be paired with SHAKE128 or SHAKE256, but those
could be handled (modulo a nasty implenentation trap) by defining
ECDSA with SHAKE128 and ECDSA with SHAKE256 algorithms.

As to what that nasty implementation trap is: With the new curves,
how the hash is converted into input z is different for SHA-2 and
SHA-3 (including SHAKE). With traditional curves, that conversion is
the same for SHA-2 and SHA-3.


> But then there are exceptions, like ES256K [2] which bundles
> signature algorithm, hash function and elliptic curve. 

I view that a past mistake.

> There are different principles in action here. Security is one, where
> a bundling is made to ensure suitable combinations.  Structure and
> economy of code points seems to be another, where it may become an
> issue managing the numbers if every potential bundling of parameters
> can get a unique assignment.

In my view "strength matching" is mostly about performance. How to
get maximum security for given budget, not that strengths of all
components are the same. Which is not well-defined anyway due to
different sub-treshold scaling (model affects the security level).

E.g., NIST P-384 is significantly stronger than AES-192.

With "256-bit level" cryptography, this does not matter much as
security levels are so stratospheric that few dozen bits here or there
matters very little.


Another part is broken combinatorial explosion of combinations. The
most well-known example of this are ciphersuites in TLS 1.2, and that
is a nightmare to implement properly (most implementations probably
fail).



-Ilari