[COSE] Re: Little-endian private key in draft-ietf-cose-bls-key-representations-06?
Ilari Liusvaara <ilariliusvaara@welho.com> Fri, 04 July 2025 15:58 UTC
Return-Path: <ilariliusvaara@welho.com>
X-Original-To: cose@mail2.ietf.org
Delivered-To: cose@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 3A8F33E5C81F for <cose@mail2.ietf.org>; Fri, 4 Jul 2025 08:58:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -1.868
X-Spam-Level:
X-Spam-Status: No, score=-1.868 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_VALIDITY_CERTIFIED_BLOCKED=0.232, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=welho.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fubvw0qE4SB1 for <cose@mail2.ietf.org>; Fri, 4 Jul 2025 08:58:16 -0700 (PDT)
Received: from smtp.dnamail.fi (sender001.dnamail.fi [83.102.40.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 69F173E5BD51 for <cose@ietf.org>; Fri, 4 Jul 2025 08:55:51 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by smtp.dnamail.fi (Postfix) with ESMTP id 457A72113E05 for <cose@ietf.org>; Fri, 4 Jul 2025 18:55:50 +0300 (EEST)
X-Virus-Scanned: X-Virus-Scanned: amavis at smtp.dnamail.fi
Received: from smtp.dnamail.fi ([83.102.40.178]) by localhost (dmail-psmtp01.s.dnaip.fi [127.0.0.1]) (amavis, port 10024) with ESMTP id rA1Jz6LNuoL1 for <cose@ietf.org>; Fri, 4 Jul 2025 18:55:49 +0300 (EEST)
Received: from LK-Perkele-VII2 (87-92-153-79.rev.dnainternet.fi [87.92.153.79]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hliusvaa@dnamail.internal) by smtp.dnamail.fi (Postfix) with ESMTPSA id 55BBD2113E04 for <cose@ietf.org>; Fri, 4 Jul 2025 18:55:49 +0300 (EEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.dnamail.fi 55BBD2113E04
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=welho.com; s=2025-03; t=1751644549; bh=d0vLL3he+7vWBZFpXrhF9eTV24zrGbI2SOXCgVywrMY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=e3G2SvNLsqTKEUZf1teoyubg80bF7BRusHfgrtiOhvx3yz4CsLkGmQqHJYKWRE7jG GcVV1xbmZbk5fVpBwzUaXk6ilRjdQrFQMgafddJOGfVQmzqthzQrzyB0NlHYdpQamO t7kF7YNUsiSvBYIFZR+UGj6hfeTa7XrJZq+DuFmcwO92qnnxxfuQhCWtoOIkoYHH3K hyx43CV26u++vNQmAeRjqP2L/aHTEse1PF5LuyO4z7GO7P9XjzOfVWZbzOz+bpwTuv kn7J1YF4oH5pTLL3fAzrBys+NWOoG2kV55YI3MAt9/fn0hCoooV/rsQIfCUeeh1a4L 6CN/z2J+Dc7kQ==
Date: Fri, 04 Jul 2025 18:55:48 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: cose <cose@ietf.org>
Message-ID: <aGf5hP7gZDwus_zv@LK-Perkele-VII2.locald>
References: <CANMnvkx-R4ZtKvFT3u1_Xso445Mwry=qb3UKgebU6iZuF+Pm4w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <CANMnvkx-R4ZtKvFT3u1_Xso445Mwry=qb3UKgebU6iZuF+Pm4w@mail.gmail.com>
Sender: ilariliusvaara@welho.com
Message-ID-Hash: NYFODKKOL4B7O22VKFFDKF36YPHUCXRL
X-Message-ID-Hash: NYFODKKOL4B7O22VKFFDKF36YPHUCXRL
X-MailFrom: ilariliusvaara@welho.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cose.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [COSE] Re: Little-endian private key in draft-ietf-cose-bls-key-representations-06?
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/rsBSNzByMETpvVxiXUWpGBtuce4>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Owner: <mailto:cose-owner@ietf.org>
List-Post: <mailto:cose@ietf.org>
List-Subscribe: <mailto:cose-join@ietf.org>
List-Unsubscribe: <mailto:cose-leave@ietf.org>
On Fri, Jul 04, 2025 at 03:11:18PM +0200, Emil Lundberg wrote: > Hi! > > Section 2.2.1. JSON Web Key Representation > <https://www.ietf.org/archive/id/draft-ietf-cose-bls-key-representations-06.html#name-json-web-key-representation> > of > draft-ietf-cose-bls-key-representations-06 defines that the private key > shall be encoded in little-endian byte order (the subsequent section for > COSE_Key does too): > > The parameter "d" MUST be present for private key representations whose > > value MUST contain the little-endian representation of the private key > > base64url encoded without padding as defined in [RFC7515] Appendix C. This > > parameter MUST NOT be present for public keys. > > > Is this right? No, that is not right. The "d" is always big-endian in EC/EC2. Then, that is not the only thing wrong with the key representation. While the rest in section 2.2.1 is fine for "G1" keys, it is not fine for "G2" keys, as those do not have valid coordinates in any prime or binary field. Then COSE key representation has further problem of base64url encoding x and y. -Ilari
- [COSE] Little-endian private key in draft-ietf-co… Emil Lundberg
- [COSE] Re: Little-endian private key in draft-iet… Ilari Liusvaara