Re: [IPsec] ChaCha20 & Poly1305, AEAD and other modes

Yoav Nir <ynir.ietf@gmail.com> Mon, 10 March 2014 08:15 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 9CCDA1A03F0 for <ipsec@ietfa.amsl.com>; Mon, 10 Mar 2014 01:15:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, HTML_MESSAGE=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 3R58I6KmbpbE for <ipsec@ietfa.amsl.com>; Mon, 10 Mar 2014 01:15:23 -0700 (PDT)
Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) by ietfa.amsl.com (Postfix) with ESMTP id 86C4F1A0320 for <ipsec@ietf.org>; Mon, 10 Mar 2014 01:15:23 -0700 (PDT)
Received: by mail-wg0-f48.google.com with SMTP id l18so3760091wgh.31 for <ipsec@ietf.org>; Mon, 10 Mar 2014 01:15:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ieICkM8cSdAzYToIJufNmloe3X0i5g5zqcptbWDT4iU=; b=t3lgCfu4cePVkxeiCc/kR8spoXLVs+kTth/pzxu7GsDfI/0sqTDQVUGiTCq5PMvg33 JbqBuFpJ1qZCmE4d6Ws2BiTBeKCVqPAaGoMRSVuqmS2LDSuzvZY6gEfMdPFJJmcx7dQQ IPwKStwxa8UMC8NXWXGK/JYw7t4Hu6bgY3df3Qe/6u7fA4vANGJOnXGJ8Ip5anImqNHC WeM9nXjq9GbnejrlEQGryWx+dQrre8gRgydQjaTI+Xok9GG+4KaVsMdh3zTJg3aygO67 FtvsF+YcKMF/tO6eDDj55HlvnLsRWclFmYHbP0YDMJoDT6LwGwy0M1bkVfT2ASs8bbib nz9w==
MIME-Version: 1.0
X-Received: by 10.194.236.9 with SMTP id uq9mr29866475wjc.31.1394439317691; Mon, 10 Mar 2014 01:15:17 -0700 (PDT)
Received: by 10.194.89.1 with HTTP; Mon, 10 Mar 2014 01:15:17 -0700 (PDT)
In-Reply-To: <531D5508.4000707@gmail.com>
References: <CAGvU-a619O9AGJcwod3uYXKNnBRhcWdZdBnoqnmuDECPHnX-6A@mail.gmail.com> <531D5508.4000707@gmail.com>
Date: Mon, 10 Mar 2014 10:15:17 +0200
Message-ID: <CAGvU-a5TSGeNm9E_k-3bnbpCtthrpS81VVXcq7AkYKjOwYQ04g@mail.gmail.com>
From: Yoav Nir <ynir.ietf@gmail.com>
To: Yaron Sheffer <yaronf.ietf@gmail.com>
Content-Type: multipart/alternative; boundary="089e01493de031204704f43c344a"
Archived-At: http://mailarchive.ietf.org/arch/msg/ipsec/e5riurbe2rpZcoshaMYM8mhXI_M
Cc: ipsec <ipsec@ietf.org>
Subject: Re: [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 08:15:25 -0000

On Mon, Mar 10, 2014 at 8:00 AM, Yaron Sheffer <yaronf.ietf@gmail.com>wrote:

> Hi Yoav,
>
> Can you explain why we need Poly1305 at all? We have SHA-2 and will
> probably adopt Keccak (SHA-3), so it's not like we don't have a backup.
>

Sure.  Poly1305 is fast.Faster than SHA-1, SHA-2, and Keccak. I haven't
compared it to GMAC on Intel, but that is fast only becuase it has special
Intel instructions like PCLMULQD. Both ChaCha and Poly1305 can be fast in a
plain C implementation, so they're fast on any platform.  Poly1305 needs
another algorithm to generate the per-message keys. That could be AES as in
DJB's original paper, or it can be ChaCha as in this draft (with or without
the AEAD).


> Let me suggest that we adopt *only* ChaCha20, which can be combined with
> any integrity protection algorithm in the normal ESP way. Is there any
> extra value (maybe code sharing?) in predefining an AEAD?
>

The AEAD version is already in at least one crypto library (NSS as used in
Chrome) and there's a patch that AGL donated to OpenSSL (not in there yet).
So in addition to AEADs being fashionable, this combination makes sense for
performance, especially on non-Intel platforms.

Yoav