Re: [Cfrg] Elliptic Curves - signature scheme: randomised or not (ends on May 13th)

"D. J. Bernstein" <djb@cr.yp.to> Mon, 11 May 2015 20:02 UTC

Return-Path: <djb-dsn2-1406711340.7506@cr.yp.to>
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 612F51A8A8D for <cfrg@ietfa.amsl.com>; Mon, 11 May 2015 13:02:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.896
X-Spam-Level: **
X-Spam-Status: No, score=2.896 tagged_above=-999 required=5 tests=[BAYES_50=0.8, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545, UNPARSEABLE_RELAY=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 GIthWoaq-RA4 for <cfrg@ietfa.amsl.com>; Mon, 11 May 2015 13:02:24 -0700 (PDT)
Received: from calvin.win.tue.nl (calvin.win.tue.nl [131.155.70.11]) by ietfa.amsl.com (Postfix) with SMTP id 673271A0248 for <cfrg@irtf.org>; Mon, 11 May 2015 13:02:24 -0700 (PDT)
Received: (qmail 24767 invoked by uid 1017); 11 May 2015 20:02:43 -0000
Received: from unknown (unknown) by unknown with QMTP; 11 May 2015 20:02:43 -0000
Received: (qmail 18470 invoked by uid 1000); 11 May 2015 20:02:13 -0000
Date: Mon, 11 May 2015 20:02:13 -0000
Message-ID: <20150511200213.18468.qmail@cr.yp.to>
From: "D. J. Bernstein" <djb@cr.yp.to>
To: cfrg@irtf.org
Mail-Followup-To: cfrg@irtf.org
In-Reply-To: <20150511152314.GG7287@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/eyi_9ykzyjA-YHPoNCqkuawiHE4>
Subject: Re: [Cfrg] Elliptic Curves - signature scheme: randomised or not (ends on May 13th)
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, 11 May 2015 20:02:26 -0000

Nico Williams writes:
> replacing M with H(M) in the second hash

This makes the signature scheme vulnerable to collisions in H. This
_shouldn't_ be a problem, since the community puts a lot of effort into
designing hash functions for which finding collisions seems to be
extremely difficult; but it's safer to build collision-resilient
signature systems, using collisions as an early-warning mechanism.

Of course, it's up to the user what to sign with a collision-resilient
signature system. In particular, instead of signing m, the user is free
to sign H(m). This throws away collision-resilience, but it can improve
cost in some applications: specifically, if H is one-pass while the
signature system isn't, then the whole procedure of signing H(m) is
one-pass, and this saves time when m doesn't fit into fast RAM. But this
combination clearly shouldn't be the default: security is job #1, and
the number of passes is irrelevant to most applications.

Similarly, the user is free to use a deterministic signature system to
sign (r,m), where r is chosen randomly for each message. This type of
randomization can in some situations reduce the cost of protecting
against, e.g., EM attacks. But again this shouldn't be the default: it
makes testing harder for everybody, raises kleptographic questions, etc.

Here's a related excerpt from http://blog.cr.yp.to/20140323-ecdsa.html:

   _Maximum security_. Ed25519 actually generates k by hashing the
   secret key together with the entire message. Very fast "PRFs" used to
   authenticate messages, such as VMAC, are safe here, but Ed25519
   simply uses SHA-512 since it's quite rare for this to be a noticeable
   bottleneck. Using an RNG wouldn't break interoperability, but the
   safest option is the default. Using Ed25519 to sign H(m), rather than
   m, would mean hashing m only once (at the expense of collision
   resilience), but again the safest option is the default.

---Dan