Re: [openpgp] AEAD Chunk Size

Jon Callas <> Tue, 16 April 2019 01:24 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 8636B1202F8 for <>; Mon, 15 Apr 2019 18:24:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.336
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: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id GPw7E9rHaZLV for <>; Mon, 15 Apr 2019 18:23:59 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 36D901202F9 for <>; Mon, 15 Apr 2019 18:23:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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 [] ( []) by (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 <>
X-Priority: 3 (Normal)
In-Reply-To: <>
Date: Mon, 15 Apr 2019 18:23:56 -0700
Cc: Jon Callas <>, Jon Callas <>, Bart Butler <>, "" <>, Justus Winter <>, "Neal H. Walfield" <>, Peter Gutmann <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <> <> <> <> <> <> <> <>
To: Derek Atkins <>
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: <>
Subject: Re: [openpgp] AEAD Chunk Size
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 16 Apr 2019 01:24:01 -0000

> On Apr 15, 2019, at 5:16 PM, Derek Atkins <> 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?