Re: [Cfrg] On why point and APIs formats matter (Re: Submission of curve25519 to NIST from CFRG -> was RE: On "non-NIST")

Dan Brown <dbrown@certicom.com> Thu, 12 March 2015 11:40 UTC

Return-Path: <dbrown@certicom.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3AEEF1A924B for <cfrg@ietfa.amsl.com>; Thu, 12 Mar 2015 04:40:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 6XEaTb5H2VNb for <cfrg@ietfa.amsl.com>; Thu, 12 Mar 2015 04:40:45 -0700 (PDT)
Received: from smtp-p01.blackberry.com (smtp-p01.blackberry.com [208.65.78.88]) by ietfa.amsl.com (Postfix) with ESMTP id 2FDE21A924A for <cfrg@irtf.org>; Thu, 12 Mar 2015 04:40:45 -0700 (PDT)
Received: from xct102cnc.rim.net ([10.65.161.202]) by mhs212cnc.rim.net with ESMTP/TLS/AES128-SHA; 12 Mar 2015 07:40:37 -0400
Received: from XCT113CNC.rim.net (10.65.161.213) by XCT102CNC.rim.net (10.65.161.202) with Microsoft SMTP Server (TLS) id 14.3.210.2; Thu, 12 Mar 2015 07:40:36 -0400
Received: from XMB116CNC.rim.net ([fe80::45d:f4fe:6277:5d1b]) by XCT113CNC.rim.net ([::1]) with mapi id 14.03.0210.002; Thu, 12 Mar 2015 07:40:36 -0400
From: Dan Brown <dbrown@certicom.com>
To: Viktor Dukhovni <cfrg@irtf.org>, "cfrg@irtf.org" <cfrg@irtf.org>
Thread-Topic: [Cfrg] On why point and APIs formats matter (Re: Submission of curve25519 to NIST from CFRG -> was RE: On "non-NIST")
Thread-Index: AdBcuVo7Nnzg/Q/f9EGPGy/ZwDiZ1A==
Date: Thu, 12 Mar 2015 11:40:35 +0000
Message-ID: <20150312114032.6463568.23668.27363@certicom.com>
Accept-Language: en-CA, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="SHA1"; boundary="===============0467813746=="
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/5nagMYv69cNjBI8SlUwHcuUx5wI>
Subject: Re: [Cfrg] On why point and APIs formats matter (Re: Submission of curve25519 to NIST from CFRG -> was RE: On "non-NIST")
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <http://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <http://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Mar 2015 11:40:47 -0000

Just to clarify, the old standards point formats are (per curve): 

fixed length octet strings,
big-endian (for mod p,n ints),
short Weierstrass,
x-only for computation purposes,

where old standards means IEEE 1363, ANSI X9.62/63, SEC1, NIST, FIPS, ...

with the _1_ exception ‎that _if_ ASN.1 is used to convey an ECDSA signature, as in PKIX/X.509, then the INTEGER type is used for r and s. If you are not using ASN.1, the old standards do not say how to encode a signature: you can encode however you like.  Weirdly, there's also an extra conversion to BIT STRING which is not even a proper way to do ASN.1: because a specific encod, DER, lands into an abstract value.   Here, I think ECDSA just followed the RSA /X.509 way.

I get the feeling that some people see ECDSA signatures in certs, and get the impression that _all_ the old point formats are variable length, and the ECDH calcs include y, etc. Wrong.

‎Also, there was an IKE spec that used both x and y for ECDH calcs, but I think that's been fixed.

Anyway, I slightly prefer the old formats, but don't mind adjusting them on a per curve basis, or perhaps per hash/KDF/signature_alg, if people say that's easy. It kinda precludes an old generic curve implementation being able to talk Curve25519 with a new implementation, but maybe that's what's wanted, anyway.

Best regards, 

-- Dan
  Original Message  
From: Viktor Dukhovni
Sent: Thursday, March 12, 2015 2:17 AM
To: cfrg@irtf.org
Reply To: cfrg@irtf.org
Subject: Re: [Cfrg] On why point and APIs formats matter (Re: Submission of curve25519 to NIST from CFRG -> was RE: On "non-NIST")

On Tue, Mar 10, 2015 at 07:20:31PM -0700, Watson Ladd wrote:

> > Your concerns about endianness are a trivial in comparison to the
> >
> > overall industry change to new public key algorithms. Please have some
> > focus
> >
> > and do not add noise to the topic.
> 
> No, they aren't: they are actually much more important than the
> question of which curve to use.

Though I still retain enough graduate school mathematics to understand
the fundamentals of EC crypto, I am not a mathematician or cryptographer.
Rather, these days I am an implementor of applications that employ
crypto, most notably Postfix where I maintain the SMTP TLS feature-set,
and I have plans to contribute DANE support to one or more TLS libraries.

So with my implementor hat on (the only hat that fits here), I'd
like very much to second Watson's remarks.

In the DANE space with 24 different combinations of the TLSA (usage,
selector, mtype) parameters not only do essentially all the other
implementations I've tried to read offer incomplete support for
some corner cases, they are also insecure for a subset of the
parameters! On top of that, users get confused and publish
incorrect records.

Yes, the analogy is rather imperfect, but I believe that the key
observations Watson makes are relevant.

(In)security will depend a lot more on how easy it is to implement
the design incorrectly than on how easy it will be to perform a
cryptanalytic attack. The curves considered here are sufficiently
strong to make implementation considerations be a key differentiator.

So if we can agree that 25519 with a fixed length little-endian
octet-string encoding (not variable length big-endian int) is more
robust in the hands of mortal implementors, that should be given
due consideration.

-- 
Viktor.

_______________________________________________
Cfrg mailing list
Cfrg@irtf.org
http://www.irtf.org/mailman/listinfo/cfrg