Re: [openpgp] AEAD Chunk Size

Jon Callas <joncallas@icloud.com> Tue, 16 April 2019 01:24 UTC

Return-Path: <joncallas@icloud.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8636B1202F8 for <openpgp@ietfa.amsl.com>; Mon, 15 Apr 2019 18:24:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.336
X-Spam-Level:
X-Spam-Status: No, score=-1.336 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, KHOP_DYNAMIC=1.363, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=icloud.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 GPw7E9rHaZLV for <openpgp@ietfa.amsl.com>; Mon, 15 Apr 2019 18:23:59 -0700 (PDT)
Received: from mr85p00im-zteg06012001.me.com (mr85p00im-zteg06012001.me.com [17.58.23.197]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 36D901202F9 for <openpgp@ietf.org>; Mon, 15 Apr 2019 18:23:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1555377838; bh=BYkIod8lu91B+JuC+AMwzVPhLfqqgJcYRqMY9nWbcRs=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=jLk8A9YudZtKfPdYtPq8aKKr/kwsAwRaDTfubsGwgAVAXu1MY5ukSxy6bjYIpCjb9 ops52+G//xToQqlC+AA1lDc0FMzjYjAf5fA2AtwjhbijgnPFvmTFCgNg7h8hhhTM0j Z+38FyK8NllNyzxn0iC+o4qRaZKyviPqo5Hh6GV2fuczXQj286+wMWmjSjhfABkbzs Va8LaEHj6lU8dujNblwiKJhSOlDS5fmiRjy2FZ+TmWwR9e0GInuLIy5FqICwIvj+k9 E7HYaNNObl1hAgROmLsZdVLemSD+tUy+FJ6Sx0k4JiGv4nPLoKp96pnPu/lQ8J+8kL K3PyNh8kkW7iw==
Received: from [192.168.7.69] (thing1.merrymeet.com [173.164.244.99]) by mr85p00im-zteg06012001.me.com (Postfix) with ESMTPSA id E9D49A0005C; Tue, 16 Apr 2019 01:23:57 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
From: Jon Callas <joncallas@icloud.com>
X-Priority: 3 (Normal)
In-Reply-To: <2dfa15ba7b415fe08df299c34bd42f61.squirrel@mail2.ihtfp.org>
Date: Mon, 15 Apr 2019 18:23:56 -0700
Cc: Jon Callas <joncallas@icloud.com>, Jon Callas <joncallas=40icloud.com@dmarc.ietf.org>, Bart Butler <bartbutler@protonmail.com>, "openpgp@ietf.org" <openpgp@ietf.org>, Justus Winter <justuswinter@gmail.com>, "Neal H. Walfield" <neal@walfield.org>, Peter Gutmann <pgut001@cs.auckland.ac.nz>
Content-Transfer-Encoding: quoted-printable
Message-Id: <766C654B-2406-483C-AE30-630B560D1E94@icloud.com>
References: <87mumh33nc.wl-neal@walfield.org> <878swzp4fb.fsf@europa.jade-hamburg.de> <E65F6E9D-8B0B-466D-936B-E8852F26E1FF@icloud.com> <87d0m9hl62.wl-neal@walfield.org> <FEE9711C-3C64-493C-8125-89696B882E0A@icloud.com> <2di2bK8m-7HtDeoUEH9oPqs-bL-IKSE0CjkgFShPMLOlUyeDBVkVGApdjnIpS6YRAeKU3ibGCZCtwLden-N6zK5W4fqIghRGDa5dU720nEs=@protonmail.com> <73739F8A-5E9F-4277-B053-FDD2E8D81B17@icloud.com> <cc75QwJwTIffqLK7fzZ3A2Pw1Vb3_lkhSHfYRPyASZcxceG2c0Cpbld529WsXosP7X9x4agikpGD4dVTXK8iaRkblS9Jokv1tD2TceQBbyE=@protonmail.com> <18FF6D9C-B285-406E-A344-E6362646DE68@icloud.com> <2dfa15ba7b415fe08df299c34bd42f61.squirrel@mail2.ihtfp.org>
To: Derek Atkins <derek@ihtfp.com>
X-Mailer: Apple Mail (2.3445.102.3)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-16_01:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1904160007
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/3b6jk_l_9IScGW5e4Yg81NAV_M4>
Subject: Re: [openpgp] AEAD Chunk Size
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Apr 2019 01:24:01 -0000


> On Apr 15, 2019, at 5:16 PM, Derek Atkins <derek@ihtfp.com> wrote:
> 
> Jon,
> 
> I would rather 256K not be the One Required Size.  It's larger than the
> RAM size on some of my systems.  I would still prefer 16K (or even 8K).

Bart, Neal? What do you guys think?

I spent part of the afternoon verifying GnuPG's chunk size. I started off using --list-packets to get the size of something, and then moved to using pgpdump. gpg --list-packets reports the combined length of all the partials as if it was one big thing, but pgpdump shows different. I found that out after I sent my last thing. I thought it was using single-chunk lengths even with some moderately large files. Only when it was showing single size for something over a gigabyte did I go grab pgpdump. 

Playing around, GnuPG aggressively uses 8K chunks, and even when I encrypted something below 8K in length, it used a 4K chunk, a 2K chunk, and then tied off the rest. 

Why not pick 8K?

Arguments in favor:

* It's what is done now.
* As noted in Bart and Neal's comments, there isn't going to be a huge performance difference.
* It works in small implementations, as Derek says.

Arguments against -- 
* I have no idea. Someone who isn't me should say something even like "I want it."

Anyone else?

	Jon