Re: [Cfrg] draft-irtf-cfrg-eddsa -- one final proposal for domain separation (context labels) for ed25519

Ilari Liusvaara <ilariliusvaara@welho.com> Fri, 22 April 2016 06:21 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5B9C512E3C6; Thu, 21 Apr 2016 23:21:29 -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_00=-1.9, RP_MATCHES_RCVD=-0.996] autolearn=ham autolearn_force=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 w7I9kKmgenp1; Thu, 21 Apr 2016 23:21:27 -0700 (PDT)
Received: from welho-filter4.welho.com (welho-filter4.welho.com [83.102.41.26]) by ietfa.amsl.com (Postfix) with ESMTP id 5AD2812E3C5; Thu, 21 Apr 2016 23:21:26 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter4.welho.com (Postfix) with ESMTP id 31B9C4CF6; Fri, 22 Apr 2016 09:21:25 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp2.welho.com ([IPv6:::ffff:83.102.41.85]) by localhost (welho-filter4.welho.com [::ffff:83.102.41.26]) (amavisd-new, port 10024) with ESMTP id 6stv3_2veP2T; Fri, 22 Apr 2016 09:21:24 +0300 (EEST)
Received: from LK-Perkele-V2 (87-100-143-35.bb.dnainternet.fi [87.100.143.35]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by welho-smtp2.welho.com (Postfix) with ESMTPSA id A098821C; Fri, 22 Apr 2016 09:21:24 +0300 (EEST)
Date: Fri, 22 Apr 2016 09:21:21 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: "draft-irtf-cfrg-eddsa.all@ietf.org" <draft-irtf-cfrg-eddsa.all@ietf.org>, "cfrg@ietf.org" <cfrg@ietf.org>
Message-ID: <20160422062121.GA27448@LK-Perkele-V2.elisa-laajakaista.fi>
References: <11c960b5f1fa42aaaf4cd0a6961332ec@usma1ex-dag1mb1.msg.corp.akamai.com> <87ziso1m0l.fsf@alice.fifthhorseman.net> <20160420142953.GA23528@LK-Perkele-V2.elisa-laajakaista.fi> <87potk1de7.fsf@alice.fifthhorseman.net> <20160420182617.GA23652@LK-Perkele-V2.elisa-laajakaista.fi> <87bn540xh3.fsf@alice.fifthhorseman.net> <20160421043947.GA24394@LK-Perkele-V2.elisa-laajakaista.fi> <alpine.GSO.1.10.1604211349530.26829@multics.mit.edu> <20160421195014.GA26169@LK-Perkele-V2.elisa-laajakaista.fi> <87zismzo9o.fsf@alice.fifthhorseman.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <87zismzo9o.fsf@alice.fifthhorseman.net>
User-Agent: Mutt/1.5.24 (2015-08-30)
Sender: ilariliusvaara@welho.com
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/ao5TBocisiG3ijunvDvKAZ16J1o>
Subject: Re: [Cfrg] draft-irtf-cfrg-eddsa -- one final proposal for domain separation (context labels) for ed25519
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2016 06:21:29 -0000

On Thu, Apr 21, 2016 at 04:43:15PM -0400, Daniel Kahn Gillmor wrote:
> On Thu 2016-04-21 15:50:14 -0400, Ilari Liusvaara wrote:
> > I actually implemented the scheme (modifying the python reference
> > implementation in the draft (modifying H(x) to be SHA512(context|x)).
> >
> > - Modified and base scheme generate identical signatures and validate
> >   identical signatures for empty context (as expected).
> > - Signature of ('abc','def') is different from signature of ('abcd','ef')
> >   and does not cross-validate. Nor does either cross-validate with
> >   ('',abcdef).
> 
> Is this because you're including the NUL octet between the context and
> the signature, or for some other reason?  if so, then i'd phrase it as:
> 
>  signature of ('abc\0', 'def') is different from signature of ('abcd\0', 'ef')
> 
> which i think everyone would agree is the right outcome.
> 
> Or are you talking about some other scheme?

No, I am not including '\0'.

I literially modified H(x) to prepend context (defaulted to blank byte
string), with no lengths nor separators to x before hashing with SHA-512..

It does not handle empty context as special case, since <empty> is
additive identity for string concatenation.

> > [ben kaduk wrote:]
> >> From where I am sitting, it seems like there are two options: does
> >> the signing API include a context input?  If yes, use that input; if
> >> no, prepend the context to the message to be signed in my own code.
> >> What am I missing?
> >
> > This does not work.
> 
> Why not?  Can you explain more?

H(x)=SHA512(context|x) does not cause behaviour like Ed25519(key,context|x)
when applied.It causes behaviour that can't be expressed using the base
Ed25519 primitive.



-Ilari