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

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Thu, 04 June 2015 06:57 UTC

Return-Path: <ilari.liusvaara@elisanet.fi>
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 9EC491A90FF for <cfrg@ietfa.amsl.com>; Wed, 3 Jun 2015 23:57:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, 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 N07BIA1c8mJ9 for <cfrg@ietfa.amsl.com>; Wed, 3 Jun 2015 23:57:03 -0700 (PDT)
Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C8CA31A90FE for <cfrg@irtf.org>; Wed, 3 Jun 2015 23:57:02 -0700 (PDT)
Received: from LK-Perkele-VII (a91-155-194-207.elisa-laajakaista.fi [91.155.194.207]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 873D58189E; Thu, 4 Jun 2015 09:56:59 +0300 (EEST)
Date: Thu, 04 Jun 2015 09:56:58 +0300
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Stephen Farrell <stephen.farrell@cs.tcd.ie>
Message-ID: <20150604065658.GA14531@LK-Perkele-VII>
References: <C49BFA4F-76B9-48A1-913B-144D606FBBDD@isode.com> <556F8811.2070101@cs.tcd.ie>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <556F8811.2070101@cs.tcd.ie>
User-Agent: Mutt/1.5.23 (2014-03-12)
Sender: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/-5dvRyP7WbtMWpT1QIVlVDp3bS4>
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, 04 Jun 2015 06:57:05 -0000

On Thu, Jun 04, 2015 at 12:04:49AM +0100, Stephen Farrell wrote:
> 
> I'd hate to miss one of Alexey's polls:-)
> 
> I'm almost neutral on this one. While we have historically preferred
> #1 for the reason noted in the subject line, there are really very few
> cases where that turns out to be a real issue, as opposed to being a
> theoretical one.
> 
> So I think we could probably live with #2, and that could suffice for
> TLS and DNSSEC and other applications, even though #2 would mean
> that users of the signature scheme (e.g. IETF protocol developers) may
> need to learn something new, which is a downside.
> 
> While #3 seems superficially attractive, my guess is it'd cause more
> confusion and interop issues, and is of course offering a choice to
> users of the scheme and so I don't like that one:-)

Having an option of hashing the message first (with an indication that
message was prehashed or even what hash was used) would be #3.

Conversely, that would be the most reasonable implementation of #3.

The reason for including hash function is to guard against trying to
confuse implementations over what hash function is used, allowing
forging signatures using stronger hashes by abusing weaker ones. The
internal hash function is much less of concern due to natural
strengthtening from hashing in various things derived from key.


> So put me down for (#2 or #1) for this one, with a very very tiny
> preference for #2 and documenting that one ought not use this for
> signing large things directly (which one probably ought not do in any
> case). But #1 would also be an acceptable outcome from my POV since
> we're in practice already dependent on the collision resistance of
> all the relevant hash functions and that won't ever really go away
> as long as there are RSA/SHA256 certificates out there which'll be
> the case for years and maybe decades to come. So the security
> benefit of #2 isn't so great, although it's real.

The problem with #1 isn't so much the CR requirement, but what it will
do to implementation safety:

Basically, it is difficult to do #1 without either:
- Prehashing the message with something capabile of signing much larger
  things. Adding an indication that this prehash has been done would give
  #3).
- Making scheme that is dangerous by breaking basic safety.


The basic safety requirements I am thinking are:

1) Determinism.

The scheme is fully deterministic.

Breaking this makes the implementations very hard to test.

2) No random/unpredictable inputs except key.

No input to functions except key may be assumed random in any way nor
unpredictable.

Breaking this makes primitive easy to misuse in ways that cause
catastrophic breakage (reveal signing private key).

3) No scalar inversions or square roots for signature

Signing must not need computing 1/x mod l or sqrt(x) mod l.

Breaking this doesn't just make scheme slow, but also causes severe
side-channel hazards.

And sidechannels matter: Modern CPUs and OSes are ridiculously vulernable,
with attackers capable of exploiting such bugs across virtual machines on
the same physical hardware.

4) No nonces in main mode

The main mode may not assume any input is not repeated.

Breaking this again makes scheme easy to misuse with very bad results
(hopefully anything using special modes will read the caveats).


Breaking any of these will cause real-world failures, as has been
demonstrated many times by ECDSA.


-Ilari