Re: [COSE] draft-ietf-lwig-curve-representations-13

Rene Struik <rstruik.ext@gmail.com> Fri, 06 November 2020 19:37 UTC

Return-Path: <rstruik.ext@gmail.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 128BE3A0B93; Fri, 6 Nov 2020 11:37:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.344
X-Spam-Level:
X-Spam-Status: No, score=-2.344 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.247, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 4MN86c65Ck4y; Fri, 6 Nov 2020 11:37:05 -0800 (PST)
Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 B02F03A0B83; Fri, 6 Nov 2020 11:37:05 -0800 (PST)
Received: by mail-qk1-x731.google.com with SMTP id i21so2143258qka.12; Fri, 06 Nov 2020 11:37:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:from:subject:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=fah3bdqB3Redh2oshleUIvGD0zimKPyG3jRmrmG0KDU=; b=Dx6zCWdFZlpsq7MaJUyXWWt992zwEfRgfGxRsGOwStoUbGdtbfw6Gl1fknncCuJUoA DlCZLO+pUoPut8yrW0ipMsrT+YyTTtVITeBr8dEBOFSxc1Ko8NDJYRv4RRafuqztDGSf wlEYdekIfM766zgzPZ0zEzIXyazCuMAzeUmi6t7WgThHca19G5TQvaYHiIpfWWkp2u9m uualZbMu3IXkqpX0DJa03j2kpzgVjLt/1eVAYMEaMmvg8tKnucr5vleUFJCC8QPToPmw KWhW25XuPgeuP21NrFiZqhLH/wY1BhSZCQPJ5ixLPFuwk+bTZH6L7T8d8TwTKx4a+AuT Tvvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=fah3bdqB3Redh2oshleUIvGD0zimKPyG3jRmrmG0KDU=; b=cNnbqJnnPzF7WlMCJB4KMyGK7BT3eiG57VlaawtDfw+NmutsJIxA0Pm78ODGCblEBs Pb7sKC0ZB8DD95VxpTCD4ZzkH89d8cM0SwpUvxLaGuf8ZlOFNHNfyo65t/RC83AaS0JO BoBzErubz56x8aBpBaOR02oKuIFRyvBILcJok7XhBbkFCnHXTJzCDHJsiU8j8M6rYB4C qs0dyH56fb6+UbA0oFpgMBl5XZwHsceBdD1r+fH33O7ip6W9EH2qWmFAc4HznLpuP4qq wu7ENDLF1wDQpw9kw6Xpp3hS+bx9cLHaYeSuv7/V1HM3z+WQGq6is7N1WVCqR8bxRDG6 6y1A==
X-Gm-Message-State: AOAM532VWNorTvDFExMaWwhCFgjwViag1v33AQiXjk0Lg0mF29+MdFp6 +YBr0MlaEclA0R46vovZOSqkytt3PBg=
X-Google-Smtp-Source: ABdhPJww/Vj9qz7xs/mTVkJIIV49sDxTaDtC0H8a/TRnBEJJV4+wZ28CGYNBm6sE7WkoGi692ZXy8w==
X-Received: by 2002:a37:a110:: with SMTP id k16mr3206932qke.285.1604691424392; Fri, 06 Nov 2020 11:37:04 -0800 (PST)
Received: from ?IPv6:2607:fea8:8a0:1397:8a4:c53a:e94:9c39? ([2607:fea8:8a0:1397:8a4:c53a:e94:9c39]) by smtp.gmail.com with ESMTPSA id o187sm1200060qkb.120.2020.11.06.11.37.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Nov 2020 11:37:03 -0800 (PST)
To: Göran Selander <goran.selander=40ericsson.com@dmarc.ietf.org>, "lwip@ietf.org" <lwip@ietf.org>, "cose@ietf.org" <cose@ietf.org>
References: <HE1PR0702MB36745AEC1C6E929CA4D9A1C7F4ED0@HE1PR0702MB3674.eurprd07.prod.outlook.com>
From: Rene Struik <rstruik.ext@gmail.com>
Message-ID: <be8f9113-a74a-7358-383c-927e7fab0f13@gmail.com>
Date: Fri, 06 Nov 2020 14:37:01 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0
MIME-Version: 1.0
In-Reply-To: <HE1PR0702MB36745AEC1C6E929CA4D9A1C7F4ED0@HE1PR0702MB3674.eurprd07.prod.outlook.com>
Content-Type: multipart/alternative; boundary="------------144DD1AAF9A57B9E9BB63104"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/o2n-ZUHebqLli7tN0OymVqjk0i4>
Subject: Re: [COSE] draft-ietf-lwig-curve-representations-13
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: Fri, 06 Nov 2020 19:37:08 -0000

Hi Goran:

Please find below some brief feedback on your note:
- the naming wei25519 has been around since the first draft (Nov 13, 
2017, i.e., 3 years minus 1 week ago), see [1]. NIST indeed produced two 
draft documents, viz. Draft NIST SP 800-186 and Draft FIPS Pub 186-5 (on 
October 31, 2019), which generated lots of (to my knowledge still 
unresolved) comments during public review. It is hard to refer to that 
document, since it is only a draft and unfortunately has quite a few errors.
- earlier versions of the lwig draft have received reviews by the crypto 
review panel (Stanislavslav Smyshlyaev), iotdir early-review (Daniel 
Migault); the sections on COSE/JOSE code point assignments resulted from 
a phone call and various email exchanges with Jim Schaad; the section on 
PKIX/CMS was suggested during IETF Last-Call secdir-review (Russ 
Housley) and reviewed by him. The document had IETF Last-Call Aug 24, 
2020. See, e.g., the status pages [1].
- ECDSA has been around since 1999, has been widely standardized, and 
has seen lots of analysis, where ECDSA25519 is simply yet another 
instantiation. Signature generation and verification times for 
ECDSA25519 should be similar to those of Ed25519 (since timing is 
dominated by scalar multiplication, where one could simply use 
Montgomery arithmetic [3]). In my personal view, ECDSA25519 may be more 
secure than Ed25519 (if only because it is non-deterministic, see 
Security section [6]); similar side-channel care has to be taken in 
either case.
  - As mentioned in the draft, one can easily switch between Wei25519 
and Curve25519 (which requires a single field addition or subtraction 
only, i.e., <.01%, see Appendix E.2 [7]). As mentioned in the draft, one 
could use Wei25519.-3 with an existing generic implementation that 
hardcodes the domain parameter a=-3, but needs to compute an isogeny and 
dual isogeny for this (adding 5-10% cost, see Appendix G.2 [8]]) and a 
~9.5kB table (see Section 5.3 [4]). However, if one already has generic 
hardware support, one may still have a significant win (see Section 6 [5]).
- The isogeny for Wei25519.-3 has odd degree l=47, which is co-prime 
with the order of the curve, so is in fact invertible. With Wei448.-3, 
the isogeny has degree l=2, so is not invertible; however, this does not 
really matter, since it is invertible with correctly generated 
public-private key pairs (which have prime/odd order) and the factor two 
is absorbed with co-factor ECDH, where h=4 then.

I hope this helps.

(*) For ease of tracking, it would help if iana related comments are 
flagged in the subject line (e.g., include (iana) in the beginning hereof).

Best regards, Rene


Ref with hyperlinks:
[1] 
https://datatracker.ietf.org/doc/html/draft-struik-lwig-curve-representations-00
[2] https://datatracker.ietf.org/doc/draft-ietf-lwig-curve-representations/
[3] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#section-4.3
[4] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#section-5.3
[5] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#section-6
[6] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#section-8
[7] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#appendix-E.2
[8] 
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-curve-representations-13#appendix-G.2

On 2020-11-06 11:19 a.m., Göran Selander wrote:
>
> Hi,
>
> Apologies for cross-posting LWIG and COSE. I had a brief look at 
> draft-ietf-lwig-curve-representations-13 and noticed it registers a 
> lot of new COSE(andJOSE, PKIX, and CMS)algorithms.Has this draft been 
> discussed in COSE(JOSE/CURDLE)? If not, perhaps it should be before 
> being progressed?
>
>   * The draft needs to manage the overlap with NIST SP 800-186, which
>     should be referenced and mappings, name of curves, etc. aligned.
>     The draft defines Wei25519 and Wei448. It is unclear if these are
>     identical to W-25519, W-448 as defined in NIST SP 800-186. We
>     probably would not want two slightly different definitions and/or
>     names, multiple COSE code points, etc.
>
>   * The draft registers the COSE algorithm "ECDSA25519" as "ECDSA with
>     SHA-256 and curve Wei25519". That is not how the other COSE
>     signature algorithms work. They work like PKIX where the curve is
>     given by the public key. Also, why cannot W-25519 be used with the
>     existing ES256 signature algorithm?
>
>   * The draft registers the COSE algorithm "ECDH25519". There are no
>     COSE ECDH algorithms for P-256, why is anECDH algorithm for
>     W-25519 be needed?
>
> Other questions. I may have missed it, but
>
>   * is it described what are the expected security properties of
>     ECDSA25519(including mapping) compared to Ed25519? For example
>     w.r.t. side channel attacks?
>
>   * has any performance measurements been made comparing
>     ECDSA25519(including mapping) and Ed25519?
>
>   * similar questions on security and performance with Wei25519.-3
>     instead of Wei25519. If I understand right, the former mapping is
>     not reversible, but could benefit from optimized code with
>     hardcoded domain parameters.
>
>   * ANSI X9.62-2005 was withdrawn in 2015 and is behind a paywall, is
>     this reference necessary?
>
> Göran
>
>
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose


-- 
email: rstruik.ext@gmail.com | Skype: rstruik
cell: +1 (647) 867-5658 | US: +1 (415) 287-3867