Re: [Cfrg] How to handle block counter wrap in IETF's ChaCha algorithm?

James Cloos <cloos@jhcloos.com> Sat, 26 January 2019 16:03 UTC

Return-Path: <cloos@jhcloos.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 3AC40130EB4 for <cfrg@ietfa.amsl.com>; Sat, 26 Jan 2019 08:03:51 -0800 (PST)
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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=jhcloos.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 cczDvN1QVVcS for <cfrg@ietfa.amsl.com>; Sat, 26 Jan 2019 08:03:49 -0800 (PST)
Received: from ore.jhcloos.com (ore.jhcloos.com [192.40.56.151]) (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 F2B80130EDC for <cfrg@irtf.org>; Sat, 26 Jan 2019 08:03:48 -0800 (PST)
Received: by ore.jhcloos.com (Postfix, from userid 10) id DAA5E1E3DB; Sat, 26 Jan 2019 16:03:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhcloos.com; s=ore17; t=1548518627; bh=Bt8rDiqqp/ewfCTTowyLzKkig76ODH4xuezclNc+Yoo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=vh9nmqAlAWZPe/fuRAsdnl121qfnrl9XfAzbQTjbGMDSJr/+u2FV1ozGXug/h5OHV PLbWV34uNw9XnDR5jCxbwxmUuChF3sv36yTEZ85pAHT1JCjukitXASjvA0oSUEMjhq cN0tOG9mxri31kV+YMfcH2jHhvvix8SecawVAJg8CstH8iwX6XVgL7k0FMDLbUUHjK U/6QKn7RiDIEHToQkweMw5GeXNWuYNMjWilUqhmrQtjoy0qTxcXQnJVFxJjRI8mWsP y+Dg+BdMxbxjQtlGhRT6mu/2LEM6nH3oyBcQmNhQGdZMZ5p7w1/xChlfv9b6mff5cI pvDh5QwPEB1BQ==
Received: by carbon.jhcloos.org (Postfix, from userid 500) id 4728524F66; Sat, 26 Jan 2019 16:03:41 +0000 (UTC)
From: James Cloos <cloos@jhcloos.com>
To: Jeffrey Walton <noloader@gmail.com>
Cc: cfrg@irtf.org
In-Reply-To: <CAH8yC8=0Y6qK0dHauib8fM-ybGozJJRA7b5vKnu8-dPVxwytLQ@mail.gmail.com> (Jeffrey Walton's message of "Fri, 25 Jan 2019 22:20:38 -0500")
References: <CAH8yC8=0Y6qK0dHauib8fM-ybGozJJRA7b5vKnu8-dPVxwytLQ@mail.gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX///8ZGXBQKKnCrDQ3 AAAAJElEQVQImWNgQAAXzwQg4SKASgAlXIEEiwsSIYBEcLaAtMEAADJnB+kKcKioAAAAAElFTkSu QmCC
Copyright: Copyright 2018 James Cloos
OpenPGP: 0x997A9F17ED7DAEA6; url=https://jhcloos.com/public_key/0x997A9F17ED7DAEA6.asc
OpenPGP-Fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
Date: Sat, 26 Jan 2019 11:03:41 -0500
Message-ID: <m3h8dvcso2.fsf@carbon.jhcloos.org>
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/F3SpRyoypWejW0tp6IsBGye_JEY>
Subject: Re: [Cfrg] How to handle block counter wrap in IETF's ChaCha algorithm?
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: Sat, 26 Jan 2019 16:03:58 -0000

There was discussion on one of the ietf lists that the upper 32 bits
should be incremented in such cases.

Ie, treat it as 64/64 instead of 32/96 but with the upper 32 bits of the
counter not always 0.

I do not recall any objections to that at the time.

(It just seemed obvious.)

I'm surprised any implementations do otherwise.

-JimC
-- 
James Cloos <cloos@jhcloos.com>;         OpenPGP: 0x997A9F17ED7DAEA6