[IPsec] ChaCha20 & Poly1305, AEAD and other modes

Tero Kivinen <kivinen@iki.fi> Mon, 10 March 2014 15:36 UTC

Return-Path: <kivinen@iki.fi>
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 CAB311A0371 for <ipsec@ietfa.amsl.com>; Mon, 10 Mar 2014 08:36:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.448
X-Spam-Level:
X-Spam-Status: No, score=-2.448 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.547, 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 9LemZ8ZA3YIJ for <ipsec@ietfa.amsl.com>; Mon, 10 Mar 2014 08:36:15 -0700 (PDT)
Received: from mail.kivinen.iki.fi (fireball.kivinen.iki.fi [IPv6:2001:1bc8:100d::2]) by ietfa.amsl.com (Postfix) with ESMTP id 90DAA1A0438 for <ipsec@ietf.org>; Mon, 10 Mar 2014 08:36:15 -0700 (PDT)
Received: from fireball.kivinen.iki.fi (localhost [127.0.0.1]) by mail.kivinen.iki.fi (8.14.7/8.14.5) with ESMTP id s2AFa7KC004913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 10 Mar 2014 17:36:07 +0200 (EET)
Received: (from kivinen@localhost) by fireball.kivinen.iki.fi (8.14.7/8.12.11) id s2AFa6J9003056; Mon, 10 Mar 2014 17:36:06 +0200 (EET)
X-Authentication-Warning: fireball.kivinen.iki.fi: kivinen set sender to kivinen@iki.fi using -f
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <21277.56294.130740.433216@fireball.kivinen.iki.fi>
Date: Mon, 10 Mar 2014 17:36:06 +0200
From: Tero Kivinen <kivinen@iki.fi>
To: Yoav Nir <ynir.ietf@gmail.com>
In-Reply-To: <CAGvU-a619O9AGJcwod3uYXKNnBRhcWdZdBnoqnmuDECPHnX-6A@mail.gmail.com>
References: <CAGvU-a619O9AGJcwod3uYXKNnBRhcWdZdBnoqnmuDECPHnX-6A@mail.gmail.com>
X-Mailer: VM 8.2.0b under 24.3.1 (x86_64--netbsd)
X-Edit-Time: 10 min
X-Total-Time: 10 min
Archived-At: http://mailarchive.ietf.org/arch/msg/ipsec/8_W-4TlElTIflx1UssEu8nU8liY
Cc: ipsec <ipsec@ietf.org>
Subject: [IPsec] ChaCha20 & Poly1305, AEAD and other modes
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: Mon, 10 Mar 2014 15:36:19 -0000

Yoav Nir writes:
> Hi
> 
> draft-nir-ipsecme-chacha20-poly1305 currently specifies three transforms:
> 
>  1. chacha20 as a stand-alone cipher
>  2. Poly1305 as a stand-alone MAC
>  3. ChaCha20-Poly1305 as an AEAD.
> 
> Some people in the room said that we should only do the AEAD and skip the
> stand-alone algorithms. This would prevent SAs with combinations such as
> ChaCha20 + HMAC-SHA1 or AES-128-CBC + Poly1305.

I would suggest only keeping the AEED.

For example AES-128-CBC + Poly1305 does not make any sense, especially
if the Poly1305 is still defined to use ChaCha20 to generate keying
material for the Poly1305, i.e. AES-128-CBC + Poly1305 will need to
implement ChaCha20 too...

We also already have multiple quite ok MACs and I assume we will have
more when SHA3 stuff goes through, so there is no need for standalone
Poly1305. There might be some uses for standalone ChaCha20, but I
think it would be more important to keep things simple, and just
define one thing and that would be AEAD mode.

> I'm not saying whether we need or don't need these combinations. I
> don't see much use for them personally. My question to the list now
> is whether everyone agrees that it's fine to drop them and leave
> only the combined mode algorithm in the draft.

BTW, One the questions I had there that as the Poly1305 requires
separate key for each invocation and the draft uses ChaCha20 to
generate key, but if I have understood correct the way it generates
the key only gives out random unpredictable keys, but it does not
generate unique keys.

If I understood correctly the original Poly1305 document used AES in a
way which did generate unique keys for each poly1305 invocation.

The draft-nir-cfrg-chacha20-poly1305 says the "The pair (r,s) should
be unique, and MUST be unpredictable...". Should we add some text
there explaining why the way in draft-nir-ipsecme-chacha20-poly1305 is
ok, i.e. that even when we truncate the 512 bit output and only take
256 bits of it, the propability of using same key twice is negligible.
-- 
kivinen@iki.fi