Re: [Cfrg] Elliptic Curves - curve form and coordinate systems (ends on March 12th)

Michael Hamburg <mike@shiftleft.org> Thu, 12 March 2015 20:40 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 78FA71A890A for <cfrg@ietfa.amsl.com>; Thu, 12 Mar 2015 13:40:43 -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 RvcP1GMaUBGO for <cfrg@ietfa.amsl.com>; Thu, 12 Mar 2015 13:40:42 -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 492A31A8ABE for <cfrg@irtf.org>; Thu, 12 Mar 2015 13:40:42 -0700 (PDT)
Received: from [10.184.148.249] (unknown [209.36.6.242]) by aspartame.shiftleft.org (Postfix) with ESMTPSA id 8EE933AA41; Thu, 12 Mar 2015 13:37:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shiftleft.org; s=sldo; t=1426192668; bh=+Rra7itQArYpxRU1o4kGg57UeYI7sMZ3NAmSaxcnFJ0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=WQqAxvjFXnUep7oQq9m1UO7WSFjWmkFetg5sOQB4pkBeVSH8wxvLZp7rsFWKMqNRT RpdzjCkVRx/TRZn1iBl5ygL3WxN9K0+I/1F26xMbXrq6G+1y1g2PpxdYJq5vzGw+af hTS9urRd2p3vwSfxSm3tloqnGhQGsoZDGgL4c9vo=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2087\))
From: Michael Hamburg <mike@shiftleft.org>
In-Reply-To: <76112F6C-8D5E-4958-888D-2076F8E3B547@shiftleft.org>
Date: Thu, 12 Mar 2015 13:40:40 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <981A9A41-719B-49F1-A289-43ECEDD1BD3E@shiftleft.org>
References: <54F8E735.2010202@isode.com> <5501E6A5.5040608@brainhub.org> <CAMfhd9VNM7q7PKfxDdZPOFAMBsyKfREUOotxtYycozvsS9UvxA@mail.gmail.com> <5501F149.2070008@brainhub.org> <76112F6C-8D5E-4958-888D-2076F8E3B547@shiftleft.org>
To: Andrey Jivsov <crypto@brainhub.org>
X-Mailer: Apple Mail (2.2087)
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/iDRh3KY7dSCZ0aMICwizyhhJzv0>
Cc: Adam Langley <agl@imperialviolet.org>, "cfrg@irtf.org" <cfrg@irtf.org>
Subject: Re: [Cfrg] Elliptic Curves - curve form and coordinate systems (ends on March 12th)
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 20:40:43 -0000

Or maybe I’m misunderstanding.  Are you still figuring that an ECDH implementation will only use the u output from the Montgomery ladder?

In that case, the ladder doesn’t have this added complexity, but I prefer Adam’s suggestion to use a sign bit instead of sending the full v coordinate.  In that case also, ECDH wouldn’t output the sign bit, so it wouldn’t be a completely unified point format, but that’s fine.

Cheers,
— Mike

> On Mar 12, 2015, at 1:26 PM, Michael Hamburg <mike@shiftleft.org> wrote:
> 
> Hi Andrey,
> 
> Have you considered the extra complexity to compute which is the correct v at the end of the Montgomery ladder?  If you want a unified point format that every operation uses, you need a way to compute the sign of v.
> 
> I get 4 u0 v1 v2 = (1 - u1 u2 - u0 u2 + u0 u1) (1 - u1 u2 + u0 u2 - u0 u1) and symmetrically.  This doesn’t require a square root if you know the input’s v coordinate, but it does increase complexity.  At some point you might as well go full decaf, particularly if there’s no trivial patch to existing curve25519() functions.
> 
> Cheers,
> — Mike
> 
>> On Mar 12, 2015, at 1:04 PM, Andrey Jivsov <crypto@brainhub.org> wrote:
>> 
>> I apologize (need more coffee). I meant to write v = SQRT(u^3 + 486662*u^2 + u). The SQRT can be calculated (for almost free) during X/Z calculation by the sender at the end of scalarmult, because the sender must do 1/Z, but there is no apparent way to avoid SQRT for the receiver (unless the received doesn't need v and only works on u). The sign is embedded in v (and v can be adjusted  p-v as needed for signatures; ECDH doesn't care).
>> 
>> On 03/12/2015 12:53 PM, Adam Langley wrote:
>>> On Thu, Mar 12, 2015 at 12:19 PM, Andrey Jivsov <crypto@brainhub.org> wrote:
>>>> I propose the Montgomery curve representation (u, v), which can be used for
>>>> signatures on the same curve.
>>>> 
>>>> "u" is identical to the sec 9 of
>>>> https://tools.ietf.org/html/draft-agl-cfrgcurve-00.
>>>> "v" is calculated (at virtually no additional computational cost) as v = u^3
>>>> + 486662*u^2 + u
>>> I'm going to display my ignorance here, but if "v" can be calculated
>>> from just u with very little cost, why send it at all? The receiver
>>> could equally calculate it if useful, no?
>>> 
>>>> * The format is friendly for crypto algorithms that need to add points (as
>>>> opposed to ECDH only)
>>> Wouldn't they need to know an extra bit? Given a point on the
>>> Montgomery curve, (u,v), the "v" value is v^2, right? Doesn't that
>>> discard the sign of v?
>>> 
>>> 
>>> Cheers
>>> 
>>> AGL
>>> 
>> 
>> _______________________________________________
>> Cfrg mailing list
>> Cfrg@irtf.org
>> http://www.irtf.org/mailman/listinfo/cfrg
> 
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> http://www.irtf.org/mailman/listinfo/cfrg