Re: [Cfrg] Elliptic Curves - curve form and coordinate systems

Andrey Jivsov <crypto@brainhub.org> Mon, 16 March 2015 08:04 UTC

Return-Path: <crypto@brainhub.org>
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 465BD1A700C for <cfrg@ietfa.amsl.com>; Mon, 16 Mar 2015 01:04:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 ZITgoxnIxOrF for <cfrg@ietfa.amsl.com>; Mon, 16 Mar 2015 01:04:45 -0700 (PDT)
Received: from resqmta-po-03v.sys.comcast.net (resqmta-po-03v.sys.comcast.net [IPv6:2001:558:fe16:19:96:114:154:162]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C52CE1A7005 for <cfrg@irtf.org>; Mon, 16 Mar 2015 01:04:45 -0700 (PDT)
Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-03v.sys.comcast.net with comcast id 484l1q00257bBgG0184lhq; Mon, 16 Mar 2015 08:04:45 +0000
Received: from [192.168.1.2] ([71.202.164.227]) by resomta-po-13v.sys.comcast.net with comcast id 484j1q00A4uhcbK0184kYf; Mon, 16 Mar 2015 08:04:44 +0000
Message-ID: <55068E9B.2050205@brainhub.org>
Date: Mon, 16 Mar 2015 01:04:43 -0700
From: Andrey Jivsov <crypto@brainhub.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
MIME-Version: 1.0
To: Michael Hamburg <mike@shiftleft.org>
References: <20150316002255.28855.qmail@cr.yp.to> <5506699C.3070006@brainhub.org> <594C037C-CA11-4836-AC3C-4CF6F19970BE@shiftleft.org>
In-Reply-To: <594C037C-CA11-4836-AC3C-4CF6F19970BE@shiftleft.org>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1426493085; bh=cEt9VD5vdxntUaA2S2YAfm+bMRffXbV+4Y1BKi7aqS8=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=DapX5sY5+rFfmJQz0FZva1Z8pZFXjerDQ7KL+4HSI16+Vhy637YfFNppSTl+CyS2d IJgimOeHWQ1j36YeSXqWMWcGpfNeKGgX0WVkBu/n4O4lL6azw+mE3EqE/TpE45a8MY fxB0dXCv2MGm+uXJc7P1v9Kq/tQq23igmHGJzfvloTuUeWMHcgccT33CZZWuMpMMN/ 2BQxN0cXTBWnhSH1LUkdB9h5U5F9d82ZBKu9shFUtwqXFyXLKw6GWIgOlfcpGez9b8 TYuFmNBWpBQgh3ZEj/ogiMr6jMc957j/XZQUS7VJih9AACASiVuVC4L4KS+9NotYFI vRylGo2pkGWYg==
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/M63Hdu9-nj_VUFALNAAXPyfPDOo>
Cc: IRTF Crypto Forum Research Group <cfrg@irtf.org>
Subject: Re: [Cfrg] Elliptic Curves - curve form and coordinate systems
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: Mon, 16 Mar 2015 08:04:48 -0000

On 03/15/2015 11:50 PM, Michael Hamburg wrote:
>> On Mar 15, 2015, at 10:26 PM, Andrey Jivsov <crypto@brainhub.org> wrote:
>>
>> In my proposal the v, the second coordinate, is only sent in the first flight (or a part of the public key in general). That's where we can expect that the Montgomery ladder will be less common. The second flight, the shared secret calculation, doesn't use v and thus there is no change to the Montgomery ladder.
>> Each 32 bytes arrive every 1/((200*10^6/8)/32) = 0.00000128 seconds (every 1.2 microsec on 200 Mbps). While we seem OK with the *whole* quad-code CPU, the CPU is a precious resource on a busy server (so in reality we are not OK in this scenario). Why pay 10% penalty?
>>
>> If we look at https://tools.ietf.org/html/rfc5246#section-6.2.1, the World is wasting 2 bytes per each
>> 2^14 bytes of traffic in the best case scenario. There is also some waste in 4K handshake and block cipher padding that could be eliminated.
> I understand that there are implementations out there other than the Montgomery ladder, and they
> require more compute time if you don’t send a v coordinate.  It may be worth discussing further
> whether the communication cost to send v is more or less than the cost for the recipient to compute
> it, though I still expect that in most cases it is cheaper to recompute v.
>
> But this just doesn’t make sense for ECDH.  You want to force *every* implementation, of
> which the considerable majority will probably be the Montgomery ladder, to send and receive an
> 32 extra bytes.  You want to add non-negligible extra complexity to the simplest implementations
> (IOT) to make this happen.  You want this so that a small (and so far hypothetical) minority of
> implementations can make a tradeoff of compute time vs communication that *still* might be
> unfavorable.  I just don’t see how this adds up.

The protocols that cannot afford a few additional lines of code like in 
the diff 
https://github.com/brainhub/curve25519-donna/commit/abc601836b75ba6399c775842647e0f3b66061c4 
might standardize on u only ( as I wrote in 
http://www.ietf.org/mail-archive/web/cfrg/current/msg06480.html ). I 
would like to hear more about these protocols, though.

On the Internet in general (YouTube, Netflix streaming) and TLS in 
particular, it's hard to see that ~32 bytes per (not reused) handshake 
matter. This part of the Internet is currently using uncompressed points 
and RSA.

>
> Cheers,
> — Mike
>
> PS: If you think it’s good to add 32 bytes to public keys to speed up signature verification, please
> consider the following proposal.  Instead of adding a second coordinate, add the u coordinate
> of 2^128 * P and a sign bit.
>
> Compared to your proposed algorithm, this u coordinate saves 128 doublings (~~ 128*6.2 M in
> extensible or extended+Hisil’s lookhaead coordinates) at the cost of an extra decompression
> (~256*0.9 M), an extra wNAF table precomputation (~8*8M), and an extra fixed table for g,
> with a net savings of about 499M.  That’s more than double what the v-coordinate saves, and
> almost the same math works for Ed448.
>
> I don’t actually want to do this.  I’m just pointing out that “we should always trade space for time”
> is a silly argument, and if you buy it then there are better ways to do it.
>