Re: [Cfrg] Elliptic Curves - signature scheme: friendliness to low memory implementations (ends on June 3rd)

Simon Josefsson <simon@josefsson.org> Thu, 21 May 2015 09:49 UTC

Return-Path: <simon@josefsson.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 AA2A71ABD37 for <cfrg@ietfa.amsl.com>; Thu, 21 May 2015 02:49:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.551
X-Spam-Level:
X-Spam-Status: No, score=-1.551 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_SE=0.35, 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 eF1H4frhPs3E for <cfrg@ietfa.amsl.com>; Thu, 21 May 2015 02:49:00 -0700 (PDT)
Received: from duva.sjd.se (duva.sjd.se [IPv6:2001:9b0:1:1702::100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 635C31A92F5 for <cfrg@irtf.org>; Thu, 21 May 2015 02:49:00 -0700 (PDT)
Received: from latte.josefsson.org ([IPv6:2001:16d8:cca1:0:a085:945e:afa2:2853]) (authenticated bits=0) by duva.sjd.se (8.14.4/8.14.4/Debian-4) with ESMTP id t4L9mm3Z014780 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 21 May 2015 11:48:50 +0200
From: Simon Josefsson <simon@josefsson.org>
To: Alexey Melnikov <alexey.melnikov@isode.com>
References: <C49BFA4F-76B9-48A1-913B-144D606FBBDD@isode.com>
OpenPGP: id=54265E8C; url=http://josefsson.org/54265e8c.txt
X-Hashcash: 1:22:150521:cfrg@irtf.org::Stx5OjQz8HOKCB6f:Iic
X-Hashcash: 1:22:150521:alexey.melnikov@isode.com::upHD+xpkOj63e8mF:3vKs
Date: Thu, 21 May 2015 11:48:46 +0200
In-Reply-To: <C49BFA4F-76B9-48A1-913B-144D606FBBDD@isode.com> (Alexey Melnikov's message of "Wed, 20 May 2015 22:16:16 +0100")
Message-ID: <87k2w2b6rl.fsf@latte.josefsson.org>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha256"; protocol="application/pgp-signature"
X-Virus-Scanned: clamav-milter 0.98.7 at duva.sjd.se
X-Virus-Status: Clean
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/dkZ29VtYhCE2QEvsdxT7It5rIss>
Cc: "cfrg@irtf.org" <cfrg@irtf.org>
Subject: Re: [Cfrg] Elliptic Curves - signature scheme: friendliness to low memory implementations (ends on June 3rd)
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, 21 May 2015 09:49:02 -0000

Alexey Melnikov <alexey.melnikov@isode.com> writes:

> Chairs wish to poll the group on the following topic (please pick one):
>
> #1: The signature scheme should follow the traditional model of hashing
> the message to be signed, thus trivially supporting IUF APIs in
> constant-space, at the cost of requiring collision resistant hash
> functions.
>
> #2: The signature scheme should not depend on collision resistance, at the
> cost of the signing algorithm having to buffer messages to be signed.
>
> #3: option #2, but with an additional "large message" mode defined for
> protocols that feel that they need it, where the message to be signed is
> actually a hash of the true message.

#2: The signature scheme should not depend on collision resistance.

The part "at the cost of the signing algorithm having to buffer messages
to be signed" appears like speculation to me, and I disagree with it.

The majority of use-cases I am aware of sign short messages.

The use-cases that sign large messages I am aware of are those that sign
offline files.  The OpenPGP EdDSA draft already deals with this issue --
see https://tools.ietf.org/html/draft-koch-eddsa-for-openpgp-02 -- since
the OpenPGP framework essentially already provide the #3 "large message
mode".  S/MIME can do the same.  I cannot recall other significant
"large file" signing frameworks.

Thus, I don't think the CFRG has to solve the "large message" problem,
at least not until some other technology requests that from us.  OpenPGP
has already solved it.  Solving problems before they exist is rarely a
good idea.

The "large message" concern and the "low memory" concern are really two
different problems, and they don't necessarily have the same solution.
Thus, I'd like to comment on your text that leads up to the question:

> Alternatively, some signature schemes hash the message to be signed
> twice, where a prefix of the second hash depends on the result of the
> first.  Ed25519 is an example of a scheme of this type. This typically
> allows the signature scheme to require fewer assumptions about the
> strength of the hash function that is employed. However, this approach
> implies that the signing algorithm would have to buffer the entire
> message. That could lead to unacceptable memory usage for applications
> that sign very large messages.

I don't agree with this.  The signing implementation does not have to
buffer the entire message.  There are several ways to solve this:

1) The application could hash the message before signing, using a
traditional hash like SHA256.  Then the signature scheme itself does not
rely on collision resistance, and the signing algorithm does not have to
do buffering.

2) The signing algorithm could have a different API and put the burden
on the caller to deal with this aspect.  By changing how the API looks
and how the application works, it is possible to avoid buffering the
entire message -- for example the application could seek through the
data stream twice when doing the signature.

Still, I believe this is a moot issue since any high-level application
that has the "large message" concern will solve this like OpenPGP does.

/Simon