Re: [COSE] Key identifier of type bstr / int

Laurence Lundblade <lgl@island-resort.com> Mon, 09 August 2021 18:11 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 63B2B3A0FD4 for <cose@ietfa.amsl.com>; Mon, 9 Aug 2021 11:11:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
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 On01o-2s4pb4 for <cose@ietfa.amsl.com>; Mon, 9 Aug 2021 11:11:27 -0700 (PDT)
Received: from p3plsmtpa12-05.prod.phx3.secureserver.net (p3plsmtpa12-05.prod.phx3.secureserver.net [68.178.252.234]) (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 C6C073A0FCA for <cose@ietf.org>; Mon, 9 Aug 2021 11:10:53 -0700 (PDT)
Received: from [192.168.0.100] ([71.92.144.145]) by :SMTPAUTH: with ESMTPSA id D9jgmMMIqUzFJD9jgmD8wR; Mon, 09 Aug 2021 11:10:52 -0700
X-CMAE-Analysis: v=2.4 cv=KIyfsHJo c=1 sm=1 tr=0 ts=61116fac a=E5cCtQzjhQJ5yJ7bKjC7Hg==:117 a=E5cCtQzjhQJ5yJ7bKjC7Hg==:17 a=48vgC7mUAAAA:8 a=QRmpseJC5sta6OmupOkA:9 a=QEXdDO2ut3YA:10 a=sPfqeAi7hdY48IWftZIA:9 a=DkXbxFwwOEzgUzWq:21 a=_W_S_7VecoQA:10 a=w1C3t2QeGrPiZgrLijVG:22
X-SECURESERVER-ACCT: lgl@island-resort.com
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <9DF382AC-12A8-47A5-AAE7-2B0D75EAA669@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_407C7130-4A3D-4855-A5FA-E3A863C64D01"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Date: Mon, 09 Aug 2021 11:10:51 -0700
In-Reply-To: <95B75634-B147-4756-A950-C6B139CF3ADD@ericsson.com>
Cc: "cose@ietf.org" <cose@ietf.org>
To: Göran Selander <goran.selander=40ericsson.com@dmarc.ietf.org>
References: <95B75634-B147-4756-A950-C6B139CF3ADD@ericsson.com>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
X-CMAE-Envelope: MS4xfLGEoO47RV0fjoB/YM3HQw5bRc7cBn/1hpxO2pPCn4lssrd+g7nADV1f/ZYc5L7sKi4vliq9hP74NpuUlsIm3WPRRNSgCdnLReJ1ZjX8UJhSxnrZo7UO fr6Vlaz00GbS1H8PYljEuRFO/Tc3gMoQFYIMxQgwF4SDaCzQI4WWWozYC0q/2dmcJwJZ1I+4Wm/I+AChmCeLIDXCPONC2MIxNtt0sqEhlfJJlHhLLLyC08I0 T1n/mi6S4sOryL6jhGeLzw==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/tldD6-nGN1rD6sPfwTOm5MRx8Jk>
Subject: Re: [COSE] Key identifier of type bstr / int
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Aug 2021 18:11:33 -0000

A small comment on code size as the author of a commercial-quality COSE implementation designed to have small code size.

There is a bit of a trade-off between code size and bytes on the wire. Reducing the bytes on the wire by one byte in this case will lead to an increase in code size by a lot more than one byte, assuming both int and bstr are supported. If both are not supported, then there is #ifdef complexity and configuration work with general purpose COSE implementations.

Most of the code cost for me in implementing COSE is in the header parameter decoding.

This desire to save 1 CBOR byte here and there at the cost of code / complexity shows up elsewhere. Here’s one from CoSWID
one-or-more<T> = T / [ 2* T ]

This could just be an array.

I don’t know the use cases, but I’m a little skeptical these sorts of things are worth a byte or two on the wire.

LL



> On Jul 30, 2021, at 5:28 AM, Göran Selander <goran.selander=40ericsson.com@dmarc.ietf.org> wrote:
> 
> Hi,
> 
> In LAKE yesterday we had a discussion on compact key identifiers. The main candidate to use, 'kid', is specified as a CBOR bstr, which is typically at least 2 bytes (exception: empty bstr which is 1 byte). We therefore want to allow keys to be identified with CBOR ints which has 48 1-byte values to allow for a larger number of optimally small identifiers.
> 
> One solution would be to define a new COSE key common parameter and COSE header parameter, say 'kid2', of type bstr / int. Another solution would be to extend 'kid' to be bstr / int.
> 
> In the former case a 'kid2' can be used to reference keys identified with either 'kid2' or 'kid', but 'kid' would not be able to reference keys identified with 'kid2' having an int value. Not clear to me if that is a problem. 
> 
> While the LAKE WG did not express any preference, one opinion I learnt after the meeting was a preference of extending 'kid' to bstr / int.
> 
> What do folks in COSE think?
> 
> I'm familiar with the process of registering new COSE parameters, what is the requirement for changing the value type of an existing registration? Standards action with expert review?
> 
> Thanks
> Göran
> 
> 
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose