Re: [TLS] Additional Elliptic Curves (Curve25519 etc) for TLS ECDH key agreement

Manuel Pégourié-Gonnard <mpg@polarssl.org> Sun, 12 January 2014 16:17 UTC

Return-Path: <mpg@polarssl.org>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CEF4A1AE005 for <tls@ietfa.amsl.com>; Sun, 12 Jan 2014 08:17:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.394
X-Spam-Level:
X-Spam-Status: No, score=0.394 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545, MIME_8BIT_HEADER=0.3, SPF_PASS=-0.001] autolearn=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 UZ16CE_cvDqA for <tls@ietfa.amsl.com>; Sun, 12 Jan 2014 08:17:57 -0800 (PST)
Received: from vps2.brainspark.nl (vps2.brainspark.nl [141.138.204.106]) by ietfa.amsl.com (Postfix) with ESMTP id D01FE1ADFF2 for <tls@ietf.org>; Sun, 12 Jan 2014 08:17:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=polarssl.org; s=exim; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To:References:To:MIME-Version:From:Date:Message-ID; bh=WUsXgCtkzbLGRuWQHPVBugbrQs+oEEJloxLlw7ulwpU=; b=PPb8NSHMO/K4Hlj0xcupg7F+6hoZLfLoy0OO39Qs1LZckIX9QHNvMuPuSI5PtMcdrbXsfwU4fdhP7rPeFAG5EDiJRI6gweJWLTj/6a9OhESUlY2kGOUojsXKP4UKY4Ft188kNToyNSIx87XHaZBxfAmmvNcOIH7sxH0g3eW8Cr8=;
Received: from thue.elzevir.fr ([88.165.216.11] helo=[192.168.0.124]) by vps2.brainspark.nl with esmtpsa (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from <mpg@polarssl.org>) id 1W2NcQ-0003CX-PA for tls@ietf.org; Sun, 12 Jan 2014 17:10:35 +0100
Message-ID: <52D2C028.4090001@polarssl.org>
Date: Sun, 12 Jan 2014 17:17:44 +0100
From: Manuel Pégourié-Gonnard <mpg@polarssl.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.1.1
MIME-Version: 1.0
To: tls@ietf.org
References: <87eh4e7a2y.fsf@latte.josefsson.org> <52D18475.10709@akr.io> <CAMfhd9VwW+XOQSRQ9sPjWvwP3Aj0jXj=hOER3g8qK8UXCYnm4A@mail.gmail.com>
In-Reply-To: <CAMfhd9VwW+XOQSRQ9sPjWvwP3Aj0jXj=hOER3g8qK8UXCYnm4A@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-SA-Exim-Connect-IP: 88.165.216.11
X-SA-Exim-Mail-From: mpg@polarssl.org
X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000)
X-SA-Exim-Scanned: Yes (on vps2.brainspark.nl)
Subject: Re: [TLS] Additional Elliptic Curves (Curve25519 etc) for TLS ECDH key agreement
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Jan 2014 16:17:58 -0000

On 11/01/2014 20:03, Adam Langley wrote:
> On Sat, Jan 11, 2014 at 12:50 PM, Alyssa Rowan <akr@akr.io> wrote:
>> But on reflection, pretty much everything else in internet standards
>> goes big-endian, so there's consistency there, and an endian swap
>> isn't exactly a big deal. No objection.
> 
> Happy to see curve25519 specified, but I do object to this. Every
> curve25519 implementation follows djb's API, which is byte orientated.
> I think it's sensible to leave the exact field representation to the
> DH function rather than have that concept spill into TLS. Maybe future
> DH functions will want to save an inversion and send extended
> coordinates or something.
> 
> Flipping the endianness just means that every single implementation
> has to undo it before feeding it into the curve25519 function.
> 
I understand your point.

Concerning implementations, unless I'm mistaken all the implementations of
Curve25519 you mention use custom routines for field arithmetic. I was thinking
about other implementations might want to use a more generic bignum library,
whose output function will probably be big-endian since that's the ordering
generally used in protocols. So for these implementations, big-endian would
probably be more natural.

(As a matter of fact, that's precisely the case of the implementation in
PolarSSL, but of course it wouldn't be fair to count it as pre-existing the
draft, since I've been involved in both the draft and this implementation.)

Manuel.