Re: [CFRG] AES-CTR + HMAC-SHA-256 AEAD

Nico Williams <nico@cryptonector.com> Mon, 15 March 2021 17:41 UTC

Return-Path: <nico@cryptonector.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 0B47D3A1834 for <cfrg@ietfa.amsl.com>; Mon, 15 Mar 2021 10:41:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.6
X-Spam-Level:
X-Spam-Status: No, score=-1.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, SUBJ_ALL_CAPS=0.5, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cryptonector.com
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 2FmxjuqRN040 for <cfrg@ietfa.amsl.com>; Mon, 15 Mar 2021 10:41:18 -0700 (PDT)
Received: from buffalo.birch.relay.mailchannels.net (buffalo.birch.relay.mailchannels.net [23.83.209.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D64113A1836 for <cfrg@ietf.org>; Mon, 15 Mar 2021 10:41:14 -0700 (PDT)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 91D46361B12; Mon, 15 Mar 2021 17:41:13 +0000 (UTC)
Received: from pdx1-sub0-mail-a75.g.dreamhost.com (100-96-16-27.trex.outbound.svc.cluster.local [100.96.16.27]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 24DD0361FAE; Mon, 15 Mar 2021 17:41:13 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from pdx1-sub0-mail-a75.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.16.27 (trex/6.1.1); Mon, 15 Mar 2021 17:41:13 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com
X-MailChannels-Auth-Id: dreamhost
X-Abortive-Power: 6b28a23d6014f825_1615830073388_790249956
X-MC-Loop-Signature: 1615830073388:2721669096
X-MC-Ingress-Time: 1615830073387
Received: from pdx1-sub0-mail-a75.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTP id D799A7E578; Mon, 15 Mar 2021 10:41:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=JraCW58LsFl58W P5XkNskL5+IHk=; b=edJr35dPWtPZlbRxzWG/rydcG1hO6L2l+VvqFu8nk65DxO cXS1FEwH9zXytE2bxfzn4HihXUDy7bWUHeF1vFYrYyUZlrW7oIbX1bwWLkTOLa0m ZoI1TS+YXTdJ0hXU0nbeHJ/rqwhBEA2oppBoT0WxhVu7aWrzacvkTglZ0W/Y0=
Received: from localhost (unknown [24.28.108.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTPSA id B35298C8B4; Mon, 15 Mar 2021 10:41:10 -0700 (PDT)
Date: Mon, 15 Mar 2021 12:41:08 -0500
X-DH-BACKEND: pdx1-sub0-mail-a75
From: Nico Williams <nico@cryptonector.com>
To: John Mattsson <john.mattsson=40ericsson.com@dmarc.ietf.org>
Cc: "cfrg@ietf.org" <cfrg@ietf.org>
Message-ID: <20210315174107.GL30153@localhost>
References: <5E976EFE-CF76-49CA-A02E-9189EB609988@ericsson.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5E976EFE-CF76-49CA-A02E-9189EB609988@ericsson.com>
User-Agent: Mutt/1.9.4 (2018-02-28)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/9x5X1pMFBNxWa83HULV-v7Ukmvg>
Subject: Re: [CFRG] AES-CTR + HMAC-SHA-256 AEAD
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
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: Mon, 15 Mar 2021 17:41:20 -0000

On Fri, Mar 12, 2021 at 11:12:38PM +0000, John Mattsson wrote:
> In the CFRG chat today, Richard Barnes asked for reviews of
> https://tools.ietf.org/html/draft-omara-sframe-01#section-4.5.1
> 
> I think standardizing an AES-CTR + HMAC-SHA-256 AEAD seems very
> useful. The design in 4.5.1 looks very good. Some comments:
> 
> - I think the nonce length Nn ciphersuite 1 and 2 should be 16. I
> don't see any reason to not use 16 bytes radnomness/salt. 
> 
> - It looks like the frame counter CTR and the block counter collide,
> but maybe I miss something.
> 
> - I note that only the aad_len is authenticated, while GCM
> authenticated both aad_len and ct_len. I don't know what is correct.

I would consider (and maybe discard or alter) the Kerberos approach to
this, which is: confounded CTS (CipheText Staling) mode with
MAC-then-encrypt (should be encrypt-then-MAC) with HMAC.

Confounding means that you prepend a block of random (or chained) IV to
the plaintext, then encrypt the resulting plaintext.  Confounding,
instead of a normal IV, is necessary in order to have a plaintext of at
least two cipher blocks when the actual plaintext is less than one
block.  CTS means no plaintext padding is needed.

Nico
--