[openpgp] Format of EC key packets

Nicola Vitucci <nicola.vitucci@gmail.com> Fri, 18 November 2016 09:48 UTC

Return-Path: <nicola.vitucci@gmail.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 836D712966B for <openpgp@ietfa.amsl.com>; Fri, 18 Nov 2016 01:48:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 eyGBuMCsGglH for <openpgp@ietfa.amsl.com>; Fri, 18 Nov 2016 01:48:50 -0800 (PST)
Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BC8C81294F7 for <openpgp@ietf.org>; Fri, 18 Nov 2016 01:48:49 -0800 (PST)
Received: by mail-wm0-x22c.google.com with SMTP id c184so4104976wmd.0 for <openpgp@ietf.org>; Fri, 18 Nov 2016 01:48:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-transfer-encoding; bh=6EMquA/hFbt1wKGddTdqUoc02O+Qs9wM7f6uZi8Aoxo=; b=G5mc74mwvyluPNNUo1ltzJ2znk7sRB+CPAiCgv0a7hTxhA1knvAJERUHsmfZWcp70E rqH7mFXws9KauOhOXkTNH741qzdAu5x2X2Pw0grmcWyTCeZR7z2r5kSc+vaZwnruAH7J hnTPkLG0vC6eVLDZ7QVRQU3+QqhS8mWzDjLnCHaG6Sc+vfvpfvaUPQOhaVwtKr2hS/Bd FXBjY7eo2D6KsdTzPeBjkar0DVkJA3Bo4/7jVu+HR75i7UpeSO9867RxCJXZfQYKolkL j7rJ+SynViPomCOB1RJyd+Md2uLS2q5rQUbZvP5Lu4DgW1vcAmM627VemHTEgPM29YJ2 HJxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:content-transfer-encoding; bh=6EMquA/hFbt1wKGddTdqUoc02O+Qs9wM7f6uZi8Aoxo=; b=T4Bt9iNTEZoS3afO/D1brqD9bvW+E4qWq5AtzDt5ZoJDidCbPQIe253VMi+5TQ4VSB 1jBh1zTgGiRmKgKZfXfMLCtsJUkPh2pO7MGJ29fU7WJUHr7SnMRbZeXy6lyctW+Xn0uF f09ugKRQe+U3mB7r39HcHm0YheV8Bf/aDBElzOcT5lySYp8227+CnqxLNPUbReQATCEo GzN3NOwPnZDuIh205BxPhwJgM6ef76+QAvXfyMZ1G+YVbs2B4tYwYoVpOLGPlEDehUsS LsH5zeNg5l9BHudYHwn1uwfe2jvjWIRTbuNAib0U9c6oODHDX1MM/gH7Vf1XOwHH6a98 0zoA==
X-Gm-Message-State: AKaTC02zaFrkIXJUmtVBGsknnew9GppR0qeB8wt44N8msPW9+SDszVAS2pKO8a0EDWiiyg==
X-Received: by 10.46.14.10 with SMTP id 10mr3864705ljo.58.1479462528031; Fri, 18 Nov 2016 01:48:48 -0800 (PST)
Received: from ?IPv6:2001:7d0:88cb:ff80:caf7:33ff:fe17:426a? (426a-fe17-33ff-caf7-ff80-88cb-07d0-2001.dyn.estpak.ee. [2001:7d0:88cb:ff80:caf7:33ff:fe17:426a]) by smtp.gmail.com with ESMTPSA id 10sm1988509ljo.36.2016.11.18.01.48.47 for <openpgp@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 01:48:47 -0800 (PST)
Message-ID: <582ECE7C.9020304@gmail.com>
Date: Fri, 18 Nov 2016 11:48:44 +0200
From: Nicola Vitucci <nicola.vitucci@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
MIME-Version: 1.0
To: openpgp@ietf.org
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/EH8jtg17mcdcJVgyC3hwmL9ztCo>
Subject: [openpgp] Format of EC key packets
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.17
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: Fri, 18 Nov 2016 09:50:46 -0000

Hi all,

I have used a recent keydump from [1] to extract keys making use of
ECCs, and I wrote some code to parse key and subkey packets (per [2],
[3] and [4]) to show the algorithm, the curve and the parameters they
use. I found cases where:

- the curve OID is not in the OpenPGP format but includes the first two
octets from ASN.1;
- the 0x40 compression flag is not included;
- when using Curve25519:
  -- the point is represented using Ed25519 compression;
  -- the point is represented using Ed25519 compression with reversed
byte order;
  -- the point is NOT represented using Ed25519 compression.

Could you explain what the current decisions are? Should these cases
just be dropped since they are not included in the RFCs? I am quite new
to the subject, so please forgive me if I am misusing any terms or concepts.

Nicola

[1] https://pgp.key-server.io/sks-dump
[2] https://tools.ietf.org/html/rfc4880
[3] https://tools.ietf.org/html/rfc6637
[4] https://www.ietf.org/archive/id/draft-koch-eddsa-for-openpgp-04.txt