Re: [TLS] [Cfrg] Citing specs in specs

Watson Ladd <watsonbladd@gmail.com> Tue, 04 March 2014 07:03 UTC

Return-Path: <watsonbladd@gmail.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 1A1361A03A3 for <tls@ietfa.amsl.com>; Mon, 3 Mar 2014 23:03:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.8
X-Spam-Level:
X-Spam-Status: No, score=0.8 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, J_BACKHAIR_44=1, J_CHICKENPOX_46=0.6, J_CHICKENPOX_51=0.6, J_CHICKENPOX_56=0.6, 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 2Pzpr_JhP87o for <tls@ietfa.amsl.com>; Mon, 3 Mar 2014 23:03:45 -0800 (PST)
Received: from mail-yh0-x229.google.com (mail-yh0-x229.google.com [IPv6:2607:f8b0:4002:c01::229]) by ietfa.amsl.com (Postfix) with ESMTP id 3D5211A01AE for <tls@ietf.org>; Mon, 3 Mar 2014 23:03:45 -0800 (PST)
Received: by mail-yh0-f41.google.com with SMTP id f73so4696884yha.28 for <tls@ietf.org>; Mon, 03 Mar 2014 23:03:42 -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:content-transfer-encoding; bh=zxhC2/ykuNnzzYlieCzcpoK3Fw9egssrV17I3Nx6kTo=; b=tTByGK51A99798VpMAlSfzyODSMaepm0vq3AnhrCt6bTLdb69eQfcbL6KK1RWDdiro TMoikmAik2bQVuLgZbihDsMTwFJy3k8/muH9VmBLl6PU0woQt+fSusOajD/r1qaZ2LyA vCd7nMQ0pFqYHDesKLbffUCu64OnMEH3/FifmdEoKchKU3njWY/Rvic9efyRWcwMHSVP TQBaHd/jcDRH1ahLoEns/gyuMdmtaVuaHUkonGoGEAsNASpVe0PLdw0cI3/hOU2phTBT YPyhyLHxDd4vLoDqqZ3vbuOsg7+XufcUUhkGDBHC2Eoot4rZvtiyU0l3dD/TUbpglqu+ Ed8w==
MIME-Version: 1.0
X-Received: by 10.236.24.196 with SMTP id x44mr6717795yhx.92.1393916621999; Mon, 03 Mar 2014 23:03:41 -0800 (PST)
Received: by 10.170.92.85 with HTTP; Mon, 3 Mar 2014 23:03:41 -0800 (PST)
In-Reply-To: <CF3B846F.3415E%paul@marvell.com>
References: <530FDC7A.4060404@cisco.com> <CABqy+srTqCXjOR4DMNgWyxf2pZ7dwZfWyznhBuJaY5w8VeuR4Q@mail.gmail.com> <5310B12E.4070603@cisco.com> <CABqy+srrbtdHOckjPqTj5SFuQwQEqXBjgc8kwagMi8E6ZRf=qg@mail.gmail.com> <28A7736F-A791-4552-8D42-DB99AC7B7F9B@vpnc.org> <CF37EA5F.338D8%paul@marvell.com> <CACsn0cmewBrOzaRF5XXC1p1A_gUSwkdE1_7V-1x8nta-ESyA+A@mail.gmail.com> <CF38F2D4.33940%paul@marvell.com> <2A0EFB9C05D0164E98F19BB0AF3708C711EF97AD05@USMBX1.msg.corp.akamai.com> <7BAC95F5A7E67643AAFB2C31BEE662D018B8516C6E@SC-VEXCH2.marvell.com> <7A2637AF-5A16-404B-B7A1-49FB17D5345A@callas.org> <CF3B846F.3415E%paul@marvell.com>
Date: Mon, 03 Mar 2014 23:03:41 -0800
Message-ID: <CACsn0cnyvkD1X5JDPJaoB83jZeFrj=uugMmWG9nPB+4jaC+POw@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Paul Lambert <paul@marvell.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/fDaiieXpXbzaMz4FEr-cG473oZc
Cc: "cfrg@irtf.org" <cfrg@irtf.org>, Jon Callas <jon@callas.org>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] [Cfrg] Citing specs in specs
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: Tue, 04 Mar 2014 07:03:47 -0000

On Mon, Mar 3, 2014 at 9:32 PM, Paul Lambert <paul@marvell.com> wrote:
>
>
> On 3/3/14, 2:52 PM, "Jon Callas" <jon@callas.org> wrote:
>
>>On Mar 2, 2014, at 3:40 PM, Paul Lambert <paul@marvell.com> wrote:
>>
>>> Implementations are possible by using the readily available open source
>>> implementation.  This is a good thing, but it is also desirable
>>> to have a unambiguous description of the algorithms that is not
>>> a C code file.  This is why we write RFCs...
>>
>>It's hard to disagree with this, in a similar way that it's hard to
>>disagree with the idea of peace on earth, living at one with nature, etc.
>>
>>But in practice, code needs to be in a computer language rather than
>>English and I've seen (and been involved with) a document that started
>>with rough consensus and running code, translated that into English, and
>>the English was (and is) devilishly hard to compile back into C.
> Yes - I¹e seen the same problem.  English is not a concise or clear way to
> document an algorithm.

Really? Because all the people doing algorithms I've seen use English
to describe their results because it is clearer then code.

For instance, consider the following short C code.

typedef struct{ member *p; int rank} member;

void init(member *a){a->p=a; rank=0;}

member * find(member *a){
   member *q=a;
   member *r=NULL;
   member *t;
   while(q !=q->p){
            t=q->p;
            q->p=r;
            r=q;
            q=t;
    }
 while (r !=NULL){
         t=r->p;
         r->p=q;
        r=t;
  }
return q;
}

void union(member *a, member *b){
   a=find(a);
   b=find(b);
   if(a->rank<b->rank){
          a->p=b->p;
          b->rank++;
    } else {
       b->p=a->p;
      a->rank++;
   }
}

The above code is of course union-find. However, I don't know what
looking at the above code tells you about the algorithm. By contrast
the following description gets the point across much more clearly.
"We consider a forest where the root node of each tree points to
itself, and pointers point up. The find operation takes the node it is
given, and follows the chain of pointers to the root, reversing each
pointer. It then descends the chain, setting each encountered pointer
to the root. The union operation links the root with lower rank to the
one with greater rank and increments the rank of the new root."

In particular the description makes clear the invariant that is
maintained: each set has a unique element that points to itself, the
rank of a node is an upper bound on the height of the tree rooted at
that node. The code makes none of this clear: it is concerned entirely
with bookkeeping that seems as important as the main idea.

For something like F5, or point counting, or inverse square root, or
direct sparse matrix factoring, or the Fast Fourier Transform, the gap
between what English is able to do and what an executable
representation can do in terms of ideas is only bigger. There is a
reason computer science produces books, not code.

>
> HAC is pretty clear and is a decent example of cryptographic algorithm
> descriptions (http://cacr.uwaterloo.ca/hac/about/chap8.pdf), but still
> uses a mix of math notation and english text.

Your use of the word "still" implies that you think the two are in
some way opposed. They aren't: programming languages have nowhere near
the capacity of expressing ideas that the English language does.

>>
>>Portably implemented algorithms are hard to do in any computer language.
>>They're harder to do in words. I don't see how you're going to get an
>>unambiguous description of the language in anything but a computer
>>language. It doesn't have to be C, it could be Python, Ruby, or Algol-58
>>(which I mention because it was originally designed as an algorithmic
>>description language). English is a suboptimal implementation language.
>
> Yes, exactly!   'Readable code¹ would be a very good way to provide an
> algorithm description.  Why bother with pseudo code when a executable
> syntax could be used.   I submitted earlier on this list some Python code
> fragments as examples of this approach.  Python allows operator
> overloading, so it can provide some very readable ECC algorithm
> descriptions.

Readable without a working Python implementation to see what happens?

Note that Python code implementing Curve25519 exists in "Cryptography
in NaCl", which also contains test vectors.
Does anyone have an objection to putting equivalent Python in the
draft/would this satisfy those calling for more documentation?
If I have the nroff source of the draft I can do it in a few hours.

Sincerely,
Watson Ladd
>
> Paul
>
>
>
>
>>
>>       Jon
>>
>



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