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

Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 18 August 2014 11:26 UTC

Return-Path: <anders.rundgren.net@gmail.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 0364C1A03F0 for <pkix@ietfa.amsl.com>; Mon, 18 Aug 2014 04:26:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] 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 Omc7aEjyOEP4 for <pkix@ietfa.amsl.com>; Mon, 18 Aug 2014 04:26:22 -0700 (PDT)
Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 958F71A03E4 for <pkix@ietf.org>; Mon, 18 Aug 2014 04:26:18 -0700 (PDT)
Received: by mail-wg0-f45.google.com with SMTP id x12so4753192wgg.4 for <pkix@ietf.org>; Mon, 18 Aug 2014 04:26:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=b7UVHeo+Tm1x6df/6yomCvAeKlL5yr/jCOMJH22RQjA=; b=vLSPss9q9yi5ktrtlB/E9lTy0U2Q8BWzMzE0/6UoETt5Z5d4Y+B2yFyIiSwAMzQ1Ra gbFwqskkATL9qcpB8nnPdNYAVIFV/4R/O9dBP1z06LKvMxTdP8Cyj2aN/bI69N8sin1u 0VbmbZ3S+HldxRuS58XAY93D0Nex4fVi0ywN9tSscls1K2hk10IGV5KR66fR4ax/yvcs bdW0co39az2fkf1K6SJBUuIlYlPAtNSKSsE5di6DAC6y9LqwiF7ng8/FrXzhKCUskvBO LxL1ivMko50JfJ7pLCb/kpTTBUHnE/kjyqF2H2LRr0MVm1p0SRAs016TGmRHOr2fOEQ+ PsAA==
X-Received: by 10.180.149.169 with SMTP id ub9mr10603875wib.32.1408361177108; Mon, 18 Aug 2014 04:26:17 -0700 (PDT)
Received: from [192.168.1.79] (233.46.14.81.rev.sfr.net. [81.14.46.233]) by mx.google.com with ESMTPSA id bt9sm41560074wjc.40.2014.08.18.04.26.16 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 04:26:16 -0700 (PDT)
Message-ID: <53F1E2C6.2040100@gmail.com>
Date: Mon, 18 Aug 2014 13:25:58 +0200
From: Anders Rundgren <anders.rundgren.net@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Johannes Merkle <johannes.merkle@secunet.com>, Michael StJohns <mstjohns@comcast.net>, 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> <53F1BF84.6010504@secunet.com>
In-Reply-To: <53F1BF84.6010504@secunet.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/pkix/iCUB0S3HqEGnQo6FBs1YgxQUt7M
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 11:26:24 -0000

I guess the same issues belong to signature standards like JWS?
https://datatracker.ietf.org/doc/draft-ietf-jose-json-web-signature/

More stuff to consider includes the NUMS (Nothing Up My Sleeve) curves from Microsoft:
http://research.microsoft.com/en-us/projects/nums/

Anders

On 2014-08-18 10:55, Johannes Merkle wrote:
> 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
>