Re: [Cfrg] Point format endian (was: Adoption of draft-ladd-spake2 as a RG document)

Watson Ladd <watsonbladd@gmail.com> Sun, 25 January 2015 06:00 UTC

Return-Path: <watsonbladd@gmail.com>
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 3C4861A212A for <cfrg@ietfa.amsl.com>; Sat, 24 Jan 2015 22:00:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 rJgborIruac4 for <cfrg@ietfa.amsl.com>; Sat, 24 Jan 2015 22:00:45 -0800 (PST)
Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4AEC31A00FB for <cfrg@irtf.org>; Sat, 24 Jan 2015 22:00:45 -0800 (PST)
Received: by mail-yk0-f179.google.com with SMTP id 142so1860272ykq.10 for <cfrg@irtf.org>; Sat, 24 Jan 2015 22:00:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9o1+eXRiBPF7mvHtYLY3fwkGdNB81Y2oJzRlhZtOVFs=; b=zrhcAhI/C5IXTj075tehd9GnF2pGH6Z+0M486+Ck8wkpnQInBAvJ9alRCqkoJNUPUa /Z5aPyQ9FVvDRSKpQJ10rsUZJ2a0Ii4raKzyt8w9uxQo65Qvo2aGhnyvzWVH4ceYyjLB L+orBecxtMPGbvuqwGvX2A7jLXDJUlak/PWiVltdKfvijGhgf4e+pHEJxxQnvg228yRV kYrcytxWR+GKVk35Uw9K86ODHQpIYUiBbnERs0A6FMQiqYpBV3EdU+YzAoXAQ06iUq9a NTgipIYshBidSg5aoSTCoEz3CAdg7e4j3I8jy/5DppyVm3W7LnMcOhfrwRVBdfdfaNFZ pAXQ==
MIME-Version: 1.0
X-Received: by 10.236.30.168 with SMTP id k28mr6481983yha.163.1422165643426; Sat, 24 Jan 2015 22:00:43 -0800 (PST)
Received: by 10.170.115.77 with HTTP; Sat, 24 Jan 2015 22:00:43 -0800 (PST)
In-Reply-To: <f52b0aefa553099613ebeab570d2e669.squirrel@www.trepanning.net>
References: <BF9DADF6-003F-454D-8E96-4A28A060CA72@isode.com> <B31EEDDDB8ED7E4A93FDF12A4EECD30D40DF8FE3@GLKXM0002V.GREENLNK.net> <04A0462F-0A20-42F3-A404-FDA6A3E5A17A@akr.io> <0bee84ff19938a1a02dca5c422602215.squirrel@www.trepanning.net> <50d4436f6a004409b297e1d8c7e72787@usma1ex-dag1mb2.msg.corp.akamai.com> <f52b0aefa553099613ebeab570d2e669.squirrel@www.trepanning.net>
Date: Sat, 24 Jan 2015 22:00:43 -0800
Message-ID: <CACsn0cmaCb4vk8w3_fv+zuev7vJQXxfQPD8eKu=T1LkP5XEZkQ@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Dan Harkins <dharkins@lounge.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/3GjFu4bzYABuQXQs_4ihk88p0kg>
Cc: "cfrg@irtf.org" <cfrg@irtf.org>
Subject: Re: [Cfrg] Point format endian (was: Adoption of draft-ladd-spake2 as a RG document)
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: Sun, 25 Jan 2015 06:00:47 -0000

On Sat, Jan 24, 2015 at 9:14 PM, Dan Harkins <dharkins@lounge.org> wrote:
>
>
> On Sat, January 24, 2015 8:18 am, Salz, Rich wrote:
>>>   So a long-standing tradition of the on-the-wire format is changed
>>> because
>>> of the way the first curve25519 library was written? That's a weak
>>> justification.
>>
>> Strongly disagree.  But this is a religious argument and the sides will
>> probably never come to terms.  On the one hand we have tradition. On the
>> other we have a large deployed base.  Within the IETF canon of rough
>> consensus and running code, which argument will win?  Which argument
>> should win?  The IETF should follow its tradition and drop its wire format
>> tradition.
>
>   To me it's not a religious argument. But when you just say "strongly
> disagree" without any justification for making such a statement then
> perhaps I guess I can see how it is religious for you.
>
>   Endianness is the lowest of low levels. It is handled by a function that
> is #define'd around an #ifdef LITTLE_ENDIAN in some _common_ include
> file. Then everything reading and writing to the network has ntoh_whatever()
> routines that call the #define'd function. It makes for portable code.
> The alternative is to put endianness knowledge into the crypto library
> and have "if (religion) then if (big endian) then foo else bar fi else
> ntoh_foo fi". Which is something to which I strongly disagree. Better to
> just say "ntoh_foo".

Really? Because if you look at DJB's code you will see that it is
host-endian independent. Maybe your code casts (*char) to (*int) in
contravention of the C standard (yes, really: the proper type punning
is via unions), but it is entirely possible to avoid needing to do
this via shifts and legitimate casts.

>
>   I remember when the discussion of curve25519 started one of the
> proponents mentioned that the idea of many people writing code to
> implement it was not necessary, and was unwise, and that everyone
> should just use the existing library. And it's that idea that prompted my
> statement. We should just change our endianness practices, which make
> better looking and more maintainable code, because whoever wrote The
> Definitive Reference Implementation of Curve25519 choose little endian
> and everyone is just expected to use that. Why? Because.

OpenBSD had no problem adopting this: I doubt they lower standards for
maintenance then you do. Besides, you probably don't know how to write
C as well as DJB, and you almost certainly don't know as much about
making secure implementations as he does. Your code will not receive
anything close to the man-decades of review and automated testing that
some Curve25519 implementations have.

>
>> The reformation is coming:  fixed on the wire curve formats are gone; it
>> is now up to each curve to specify its wire rep.
>
>   And yet counter-reformation was much more grand and beautiful
> and majestic as compared to the cold, boring, puritan, calvinist
> reformation. Really, it's not anything that needs to be repeated.

Edwards curves could have been shoehorned into the SEC1 formats by
using the isomorphic Weierstrass form. Is that what you want? Or do
you want some other curve format (like x-coordinate Montgomery
little-endian) for all the new curves (of which we only have 1 right
now)?

Sincerely,
Watson Ladd
>
>   Dan.
>
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> http://www.irtf.org/mailman/listinfo/cfrg



-- 
"Those who would give up Essential Liberty to purchase a little
Temporary Safety deserve neither  Liberty nor Safety."
-- Benjamin Franklin