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

Adam Langley <agl@google.com> Sun, 12 January 2014 19:54 UTC

Return-Path: <agl@google.com>
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 0B4BE1ACC85 for <tls@ietfa.amsl.com>; Sun, 12 Jan 2014 11:54:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.617
X-Spam-Level:
X-Spam-Status: No, score=-1.617 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, MIME_8BIT_HEADER=0.3, RP_MATCHES_RCVD=-0.538, 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 4f_0KHNih_CQ for <tls@ietfa.amsl.com>; Sun, 12 Jan 2014 11:54:19 -0800 (PST)
Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) by ietfa.amsl.com (Postfix) with ESMTP id 2E2621ACAD7 for <tls@ietf.org>; Sun, 12 Jan 2014 11:54:19 -0800 (PST)
Received: by mail-oa0-f47.google.com with SMTP id i7so7163775oag.34 for <tls@ietf.org>; Sun, 12 Jan 2014 11:54:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=hGIk5dSgtrOoCDL080+CVRXhSfonyWX/pkrbynawKgo=; b=W3TrUOHvB+SrWCZh02TArOIfbGAaD3SxuQzXSvzcLU1nl8x37TFbyKLzw5ZOelQZqf ueh5cy0aSxOV6IShgPHUAewxzJrcNUPTxynI7Vl+FRRTh4PN2nIyhxqFuKhYPS8MFyaJ ugHv6xWxtZ8vzdQyscLnBcb7oI0+3kzCj+RDnBEtS1fUTd6j1ZjvE+mS8oX9BDxU+zA/ w0Dh8S3pXf8dp7Hl3Lgr9fquI6f6hWA5W0tO9kw7IR0I5sgdnVzpYxXp7dfdrQJEeoL5 /WuZJj2Cpud6ObDP7nKjksftXht1l5KWWeVOYBfKfLGDPkMiaRNgu/3XznZWr7JLEjFQ PWbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=hGIk5dSgtrOoCDL080+CVRXhSfonyWX/pkrbynawKgo=; b=MGAyJQ3mDfSlWM4pDBEFDJTH4isH6ihyAGqEDnTMNMOjKksdemwaWV52zrQ8jY+z5g LAC2c8GFRe31SDxXkD9tPuS5qgaMOhLubxKNANLHSCAKascUHdtWEtfFOPn+qm5c3FP2 a/wVBYM9U1DFGBDbxi2NQEeyBQHen6oiNU0vZ73tBlebLjDt9yXMwq+thpG6gvWueE+F aXH+mWS6x8syVpDlWdTx3Pc9tv1ie+mCxOA2GJzP+JSzjUWhYy025UeR1EiTRwKG5xKb 40xowD1LVbx3qZAzwTp9WK9zvYVVldTACip8CJZp4JyaKTM4IlzlFlb38z1YRdIkVxeI QfUQ==
X-Gm-Message-State: ALoCoQn1uR7SYo36BpXIZpGD3oZTo+lu8FqTjZV+Z01NOBjUNwxBoHnZh447N4m9ia53z7mmz0Oqu5rWxrcglHV15mtJB0XUVzL0AxwsMNf7bDdVRtQGs8S34yyNJj5NCf4PJCWoFwuMJnYVkqWBH4OK3a1mITF3aE8bOmU/iuaGbpYmcTmIKJ0rurUTvZLZr80irZUXHR6Z
X-Received: by 10.182.148.106 with SMTP id tr10mr26367obb.65.1389556448152; Sun, 12 Jan 2014 11:54:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.182.79.105 with HTTP; Sun, 12 Jan 2014 11:53:48 -0800 (PST)
In-Reply-To: <52D2C028.4090001@polarssl.org>
References: <87eh4e7a2y.fsf@latte.josefsson.org> <52D18475.10709@akr.io> <CAMfhd9VwW+XOQSRQ9sPjWvwP3Aj0jXj=hOER3g8qK8UXCYnm4A@mail.gmail.com> <52D2C028.4090001@polarssl.org>
From: Adam Langley <agl@google.com>
Date: Sun, 12 Jan 2014 14:53:48 -0500
Message-ID: <CAL9PXLwTDHVWnQ1pAdpoyoe1MeN3VwZudnw5jbxR_Js+aT7-=A@mail.gmail.com>
To: Manuel Pégourié-Gonnard <mpg@polarssl.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: "tls@ietf.org" <tls@ietf.org>
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 19:54:20 -0000

On Sun, Jan 12, 2014 at 11:17 AM, Manuel Pégourié-Gonnard
<mpg@polarssl.org> wrote:
> 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.

Using a generic bigint library is tough if you want to be constant
time. (For example, integer division on Intel is variable time.)

Also, internally, the library likely stores values as a series of
words in little-endian order and is likely to be operating on
little-endian systems, so little-endian is the more native
representation.

I guess my overall point is that I don't see the concept of an
"integer" as being a good one to put into TLS here. I think keeping a
DH function as something that operates on bytestrings makes sense.
Maybe they'll want to operate on binary fields, or compress the 'y'
coordinate into one of the unused bits, or export a different
coordinate form.


Cheers

AGL