Re: [pkix] Edwards/DJB curves - New PKI(X) work?

Johannes Merkle <johannes.merkle@secunet.com> Mon, 18 August 2014 08:55 UTC

Return-Path: <Johannes.Merkle@secunet.com>
X-Original-To: pkix@ietfa.amsl.com
Delivered-To: pkix@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A1EE41A0367 for <pkix@ietfa.amsl.com>; Mon, 18 Aug 2014 01:55:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.268
X-Spam-Level:
X-Spam-Status: No, score=-3.268 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.668] autolearn=ham
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 UgF8AktILzd3 for <pkix@ietfa.amsl.com>; Mon, 18 Aug 2014 01:55:48 -0700 (PDT)
Received: from a.mx.secunet.com (a.mx.secunet.com [195.81.216.161]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 03CF11A035D for <pkix@ietf.org>; Mon, 18 Aug 2014 01:55:47 -0700 (PDT)
Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id C0FB41A007A; Mon, 18 Aug 2014 10:55:42 +0200 (CEST)
X-Virus-Scanned: by secunet
Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kGkM8VE6zOLy; Mon, 18 Aug 2014 10:55:38 +0200 (CEST)
Received: from mail-essen-01.secunet.de (unknown [10.53.40.204]) by a.mx.secunet.com (Postfix) with ESMTP id F22EA1A0078; Mon, 18 Aug 2014 10:55:29 +0200 (CEST)
Received: from [10.208.1.76] (10.208.1.76) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 18 Aug 2014 10:55:32 +0200
Message-ID: <53F1BF84.6010504@secunet.com>
Date: Mon, 18 Aug 2014 10:55:32 +0200
From: Johannes Merkle <johannes.merkle@secunet.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Michael StJohns <mstjohns@comcast.net>, Anders Rundgren <anders.rundgren.net@gmail.com>, pkix@ietf.org
References: <53EC3F1F.6090706@gmail.com> <53EC9E72.8030701@bbn.com> <53EC9F34.7090403@gmail.com> <53ECCCE4.2060603@secunet.com> <53ECDE4F.6020009@gmail.com> <53EDB8F3.3020400@secunet.com> <20140817032441.012621A0066@a.mx.secunet.com>
In-Reply-To: <20140817032441.012621A0066@a.mx.secunet.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.208.1.76]
Archived-At: http://mailarchive.ietf.org/arch/msg/pkix/VZqs0FD8AXX-0gdRrI-pzZU9G-w
Subject: Re: [pkix] Edwards/DJB curves - New PKI(X) work?
X-BeenThere: pkix@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: PKIX Working Group <pkix.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/pkix>, <mailto:pkix-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/pkix/>
List-Post: <mailto:pkix@ietf.org>
List-Help: <mailto:pkix-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/pkix>, <mailto:pkix-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Aug 2014 08:55:50 -0000

Michael StJohns wrote on 17.08.2014 05:16:
> At 03:38 AM 8/15/2014, Johannes Merkle wrote:
>> The usage of ECDSA-SHA256 within PKIX is already fully specified in RFC 5758. The curve (more specifically, the elliptic
>> curve parameters) are a property of the public key not of the digital signature, DH value or cipher text.
>> In order to use other curves, you just need to replace the OID for the named curve which is a parameter of the
>> SubjectPublicKeyInfo according to RFC 5480.
> 
> 
> If I had to make a guess as to whether this is correct or not I'd say that it mostly isn't.  Starting with PKIX public key representation, the OID for the AlgorithmIdentifier.algorithm type idEcPublicKey specifies how the public key is formatted; the curve OID (included in the parameters field) merely describes the curve parameters by reference.   (Section 2.2 of RFC5480 - but other places as well).  So you can't really reuse that algorithm type identifier.
> 
> Then there's the actual verification process.  The code I use for example looks first at the SignatureAlgorithm field of a certificate.  When it sees "SHA256withECDSA",  it instantiates a Signature object of that specific type *before* grabbing the appropriate public key to initialize the verification operation.   In other words, I'm stuck with  FIPS186-3 compliant signature function trying to parse a DJB curve key.
> 
> Basically, while you're correct that the key  curve is going to determine how you verify the signature, I would be surprised if any code checks the key curve first as the current understanding is that ECDSA means SECG1/X9.62/NISP FIPS186-3 (which are basically the same math and representations).  
> 


You are right, I was imprecise. As I wrote in my previous message:

  Even if
  Montgomery curves or Edwards curves are chosen, there is still the option of using traditional (Weierstrass)
  representation / semantic on-the-wire, as transformation is quite simple. See
  https://www.ietf.org/mail-archive/web/cfrg/current/msg04816.html

My statement above (that using a new curve only requires a curve OID) only referred to the case that the representation
of the EC points don't change. In the alternative case, you are right: if we want to use new EC point semantics, new
specs for X.509 certs / CRLs, for CMS etc. would be needed.

> For PKIX at least for signatures you need:
>
> 1) An ASN1 public key representation (and the appropriate OID).  Since there's only one DJB curve(?is that correct or
are two needed for signature and ecdh?), you could get away with just a new OID for AlgorithmIdentifier.algorithm.
> 2) The format of the bitstring that represents a signature
> 3) One or more signature algorithms (e.g. SHA256withX, SomeOtherHashWithX, etc) and their OIDs.
>

I disagree with 2) though: In all Schnorr-like signatures, the signature consists of two integers, not (EC) group
elements. Thus, the EC point semantic has no influence on the signature encoding. It only has impact on the signature
generation and verification algorithms (e.g. defined in ANSI X9.62 and FIPS 186-4), but these are out of the scope of PKIX.

Of course, if new signature algorithms are introduced in PKIX (3), this implies that new semantics of signature values (2).

Johannes