Re: [IPsec] ChaCha20/Poly1305 padding (was: I-D Action: draft-ietf-ipsecme-chacha20-poly1305-01.txt)

Yoav Nir <ynir.ietf@gmail.com> Wed, 01 April 2015 14:50 UTC

Return-Path: <ynir.ietf@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 90E391A1A67 for <ipsec@ietfa.amsl.com>; Wed, 1 Apr 2015 07:50:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 6HdWf5zYu_Qy for <ipsec@ietfa.amsl.com>; Wed, 1 Apr 2015 07:50:24 -0700 (PDT)
Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A82071ACCF4 for <ipsec@ietf.org>; Wed, 1 Apr 2015 07:50:13 -0700 (PDT)
Received: by widdi4 with SMTP id di4so47838479wid.0 for <ipsec@ietf.org>; Wed, 01 Apr 2015 07:50:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0c2UTqgyeY9SPERnOGwOuTvs20MxG6TswEwZryHNwbk=; b=Ms6Q9seXX5jZkb9sL8gRVGxOdHBsjuR20adXlFfQE6Ljq54VdVA5f86Kc/zliDFgmw zaGkCYshJOH1Daa6az7tiBYKyL5lapOOsf67GkhuXDdlPUSAcrJp/F/hs69DAQ8sN/yj hYuks8JgcSOeFAC2Ckw+/7bgZ0WG3z41eOfYKjkae7O5LdVwBR6AFICOhAc5pME6NF2W MfAdbLmkKu6oEy0mM9eBbka7W4CoozkHAERnmfLiTxTWAjiyEo0KdLAE9DBCyNoW5CN+ re18/Dc7HMc7ZIb5SHQizAtNusjnan9H62m9O0bmHv0g9rL2HSkX2vslPPabMynkxDdU V7jg==
X-Received: by 10.181.12.14 with SMTP id em14mr1261470wid.55.1427899812245; Wed, 01 Apr 2015 07:50:12 -0700 (PDT)
Received: from yoavs-mbp.mshome.net ([176.12.139.254]) by mx.google.com with ESMTPSA id r14sm3500747wiv.13.2015.04.01.07.50.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Apr 2015 07:50:11 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
From: Yoav Nir <ynir.ietf@gmail.com>
In-Reply-To: <1427891865.3514.16.camel@martin>
Date: Wed, 01 Apr 2015 17:50:02 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <6A224480-AA4E-4186-9303-A93EE5CC6270@gmail.com>
References: <20150331105545.775.28233.idtracker@ietfa.amsl.com> <1427891865.3514.16.camel@martin>
To: Martin Willi <martin@strongswan.org>
X-Mailer: Apple Mail (2.2070.6)
Archived-At: <http://mailarchive.ietf.org/arch/msg/ipsec/c-VEttpFnxFUid5HVwn2YXiNWh0>
Cc: ipsec@ietf.org
Subject: Re: [IPsec] ChaCha20/Poly1305 padding (was: I-D Action: draft-ietf-ipsecme-chacha20-poly1305-01.txt)
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Apr 2015 14:50:32 -0000

> On Apr 1, 2015, at 3:37 PM, Martin Willi <martin@strongswan.org> wrote:
> 
> Hi,
> 
> In Section 2, draft-ietf-ipsecme-chacha20-poly1305-01 has the following
> text: 
> 
>>   o  Finally, the Poly1305 function is run on the data to be
>>      authenticated, which is, as specified in section 2.7 of
>>      [chacha_poly] a concatenation of the following in the below order:
>> 
>>      *  The Authenticated Additional Data (AAD) - see Section 2.1.
>>      *  The AAD length in bytes as a 32-bit network order quantity.
>>      *  The ciphertext
>>      *  The length of the ciphertext as a 32-bit network order
>>         quantity.
> 
> First, I assume [chacha_poly] should be updated to
> draft-irtf-cfrg-chacha20-poly1305, where section 2.7 is now 2.8?

Right you are. Thanks. I’ve fixed it in my local storage. draft-irtf-cfrg-chacha20-poly1305 is now in the RFC editor’s queue. In a few weeks it will be published as an RFC, and then I will update the reference.

> draft-irtf-cfrg-chacha20-poly1305-10 2.8 defines AEAD construction for
> Poly1305 with padding and a final block with two 64-bit little endian
> length fields; in contrary to what is defined here.

Oh, right. That justifies a new revision immediately. The question is whether I should just delete the bullet points, leaving only the reference to the CFRG document, or fix it here.

> The GCM-like padding is certainly preferable, as it allows
> implementations to run four Poly1305 iterations on each ChaCha20 block.
> This is not only simpler, but allows parallel ChaCha20/Poly1305
> processing without operating on partial blocks.

I doubt it would produce a measurable difference in performance, but I agree.

Yoav