Re: [Cfrg] Fwd: I-D Action: draft-turner-thecurve25519function-00.txt

Tanja Lange <tanja@hyperelliptic.org> Wed, 30 July 2014 21:10 UTC

Return-Path: <tanja@hyperelliptic.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 B8C7F1A046A for <cfrg@ietfa.amsl.com>; Wed, 30 Jul 2014 14:10:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] 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 RXwmLe4xfGel for <cfrg@ietfa.amsl.com>; Wed, 30 Jul 2014 14:10:17 -0700 (PDT)
Received: from mace.cs.uic.edu (mace.cs.uic.edu [131.193.32.224]) by ietfa.amsl.com (Postfix) with SMTP id F29061A052E for <cfrg@irtf.org>; Wed, 30 Jul 2014 14:10:16 -0700 (PDT)
Received: (qmail 8324 invoked from network); 30 Jul 2014 21:10:18 -0000
Received: from unknown (HELO hyperelliptic.org) (131.155.71.33) by mace.cs.uic.edu with SMTP; 30 Jul 2014 21:10:18 -0000
Received: (qmail 9298 invoked by uid 1000); 30 Jul 2014 21:09:46 -0000
Date: Wed, 30 Jul 2014 23:09:46 +0200
From: Tanja Lange <tanja@hyperelliptic.org>
To: Robert Ransom <rransom.8774@gmail.com>
Message-ID: <20140730210946.GL28679@cph.win.tue.nl>
References: <20140729195926.2156.45746.idtracker@ietfa.amsl.com> <0D69E8E1-336C-4884-A87F-7656432AEB15@ieca.com> <CABqy+sroxMhZ=N1o26YG58e3JEj4qdw8=E_dL3D+o2rV-4D3bw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CABqy+sroxMhZ=N1o26YG58e3JEj4qdw8=E_dL3D+o2rV-4D3bw@mail.gmail.com>
User-Agent: Mutt/1.5.11
Archived-At: http://mailarchive.ietf.org/arch/msg/cfrg/A1RsnVMvgWmBF0qx9IIjQXxP3eY
Cc: Sean Turner <TurnerS@ieca.com>, cfrg@irtf.org
Subject: Re: [Cfrg] Fwd: I-D Action: draft-turner-thecurve25519function-00.txt
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: Wed, 30 Jul 2014 21:10:20 -0000

Dear Robert,
> Section 3:
> 
> * The draft correctly specifies that the high bit must be discarded,
> but does not mention that that differs from the specification in the
> Curve25519 paper, and does not explain the reasons for that difference
> (resistance to implementation fingerprinting, and forward
> compatibility with point formats which preserve the sign bit for use
> in other protocols).  It should do both, so that the RFC won't be
> ‘corrected’ to match the paper when someone else notices that
> difference five or more years from now.
> 
The paper specifies that the x value is an integer between 0 and p-1. 
It does not specify what to do if the sent value does not adhere to 
this format. On the math side, there is no attack from accepting 
DH inputs which do not match this format, but for specifications
I want a defined format.

The text specifies that s[31] is minimal; the representation is
unique.

> * The draft correctly specifies that implementations must produce
> outputs less than the field order p, but does not explicitly state
> that implementations must accept inputs which are greater than or
> equal to p (and silently reduce them mod p).
> 
Why would you do this? If the DH input is >=2^255-19 then it was
not generated according to the specification and should be rejected.

If you want to have the ambiguity of having multiple representations
for inputs (which I would recommend against) there is still no need 
to reduce modulo p. The computation could start from the unreduced
value and give the same result.

Do you see any benefit in having non-unique representations? Any 
problems with rejecting malformed inputs?

All the best
	Tanja