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

Michael Hamburg <mike@shiftleft.org> Mon, 16 March 2015 17:10 UTC

Return-Path: <mike@shiftleft.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 296D41A878E for <cfrg@ietfa.amsl.com>; Mon, 16 Mar 2015 10:10:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.555
X-Spam-Level: *
X-Spam-Status: No, score=1.555 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FH_HOST_EQ_D_D_D_D=0.765, FH_HOST_EQ_D_D_D_DB=0.888, HELO_MISMATCH_ORG=0.611, HOST_MISMATCH_NET=0.311, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, 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 Uecb_BmORAjI for <cfrg@ietfa.amsl.com>; Mon, 16 Mar 2015 10:10:08 -0700 (PDT)
Received: from aspartame.shiftleft.org (199-116-74-168-v301.PUBLIC.monkeybrains.net [199.116.74.168]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AB3B21A88C4 for <cfrg@irtf.org>; Mon, 16 Mar 2015 10:10:08 -0700 (PDT)
Received: from [192.168.1.107] (unknown [192.168.1.1]) by aspartame.shiftleft.org (Postfix) with ESMTPSA id 73BE43AA41; Mon, 16 Mar 2015 10:06:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shiftleft.org; s=sldo; t=1426525618; bh=jN+uocbvazwCXZTDA/n1mPE5Hz5vCbXQxOCyVUu+3H0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=GFtEboZ6JBF78V0ee7WNOkiMWG7Qls5R2i49b4M0Rh1czRGF+ekcQS4jIEKVwczkL VDix/APtQaU8zSw4hCb2eUYKunSvcjxSW9fNqULkRhgvh9HlEQD4Khbe9Q98G6Ruio 7sCigsj+lU4hErMniukDncBChYhGZ/NDuA2IK3vA=
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2087\))
From: Michael Hamburg <mike@shiftleft.org>
In-Reply-To: <55068E9B.2050205@brainhub.org>
Date: Mon, 16 Mar 2015 10:10:07 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <B99A2894-E964-4B0C-AFE1-1FEF377380AF@shiftleft.org>
References: <20150316002255.28855.qmail@cr.yp.to> <5506699C.3070006@brainhub.org> <594C037C-CA11-4836-AC3C-4CF6F19970BE@shiftleft.org> <55068E9B.2050205@brainhub.org>
To: Andrey Jivsov <crypto@brainhub.org>
X-Mailer: Apple Mail (2.2087)
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/Rh_0Cth3D-HEgMKbr7wNscE7dbs>
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 17:10:10 -0000

> On Mar 16, 2015, at 1:04 AM, Andrey Jivsov <crypto@brainhub.org> wrote:
> 
> 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.

Maybe this doesn’t exist in the use cases of TLS, even though IoT devices can be pretty limited.

I work in the deeply embedded space, where every byte of code or data costs something.  At some point I wrote NIST p256 math and point add, double, and isqrt in 600 bytes of code.  We ended up not needing it for that project but we are likely to need something similar for the next one.  It was isqrt instead of inverse so that we could decompress points, because even with code limitations we couldn’t afford to store public keys uncompressed in NVM.  The bandwidth wasn’t a problem in that project, 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.

I agree that we’re arguing over minutiae, but I’m not satisfied with “wasting 32 bytes for no clear purpose is a good idea because other people waste bytes too”.

— Mike