Re: [COSE] [Rats] RAM requirements for COSE/CWT
Laurence Lundblade <lgl@island-resort.com> Tue, 22 February 2022 19:45 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 A52073A0C01
for <cose@ietfa.amsl.com>; Tue, 22 Feb 2022 11:45:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.886
X-Spam-Level:
X-Spam-Status: No, score=-1.886 tagged_above=-999 required=5
tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H5=0.001,
RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
T_KAM_HTML_FONT_INVALID=0.01, 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 uJ2sRifk1CJJ for <cose@ietfa.amsl.com>;
Tue, 22 Feb 2022 11:45:26 -0800 (PST)
Received: from p3plsmtpa11-03.prod.phx3.secureserver.net
(p3plsmtpa11-03.prod.phx3.secureserver.net [68.178.252.104])
(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 446E33A0D37
for <cose@ietf.org>; Tue, 22 Feb 2022 11:45:26 -0800 (PST)
Received: from [192.168.1.4] ([75.80.148.139]) by :SMTPAUTH: with ESMTPA
id Mb6CnX1pOG1F2Mb6Dnz3JQ; Tue, 22 Feb 2022 12:45:25 -0700
X-CMAE-Analysis: v=2.4 cv=U8FXscnu c=1 sm=1 tr=0 ts=62153d55
a=qS/Wyu6Nw1Yro6yF1S+Djg==:117 a=qS/Wyu6Nw1Yro6yF1S+Djg==:17 a=gKmFwSsBAAAA:8
a=K6EGIJCdAAAA:8 a=BqEg4_3jAAAA:8 a=2Q9Dci1z6P6FCltAV_EA:9
a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 a=oGJOgYjebJQA:10
a=l4vvl7GWfogA:10 a=RaAxL4TVS7fp6cBitRoA:9 a=EkWIX-WiTnmdooCm:21
a=_W_S_7VecoQA:10 a=nnPW6aIcBuj1ljLj_o6Q:22 a=L6pVIi0Kn1GYQfi8-iRI:22
a=0mFWnFbQd5xWBqmg7tTt:22
X-SECURESERVER-ACCT: lgl@island-resort.com
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <ED025590-3CA0-42B8-B50E-030D94FA88D6@island-resort.com>
Content-Type: multipart/alternative;
boundary="Apple-Mail=_B790E350-0742-414A-A829-D7AF833E4913"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Date: Tue, 22 Feb 2022 11:45:24 -0800
In-Reply-To: <59939C29-5370-4385-AE61-A21ADDC0D194@tzi.org>
Cc: Anders Rundgren <anders.rundgren.net@gmail.com>,
"rats@ietf.org" <rats@ietf.org>, "cose@ietf.org" <cose@ietf.org>
To: Carsten Bormann <cabo@tzi.org>
References: <e8995f0c-ad85-f702-da6b-051ffdc4cb08@gmail.com>
<DBBPR08MB5915B874FD16107A7B0105AAFA3A9@DBBPR08MB5915.eurprd08.prod.outlook.com>
<1a16c80d-40cd-baba-b1ce-2033dd0db294@gmail.com>
<D22D0D63-F76C-48B3-A034-F8B5B2BB6005@tzi.org>
<2c8be442-9899-d117-155c-f6f2096b7055@gmail.com>
<92C7CF7C-ED23-41B3-AB32-8438C4C88C20@tzi.org>
<14c8d106-3b4b-f973-94b8-018852ff4769@gmail.com>
<8C2C6592-D5B9-430A-B878-E1009E9BCF22@tzi.org>
<AB9F0C55-9C23-43F1-A83F-91D4159C888F@island-resort.com>
<59939C29-5370-4385-AE61-A21ADDC0D194@tzi.org>
X-Mailer: Apple Mail (2.3445.104.17)
X-CMAE-Envelope: MS4xfNkrW+g8rVt4rUkF2AL9Wo4Cvu6sxOqDtS8k0qiaOGfLiLmon7s4YyeAdDBHjNgw+DaIPhHU3+duG3TP65FkoF5AsTzrz6tCxUcOUPBgRShAlMZ5hoDV
DS+y0BDO31Ip2MNbshUuBGluRHo8kYIH6Y77zeERhMIi2SX54kexg2VApqhMulS1gyPJ0ysPsgkodsxx3zZ+WcYAQopSDtqsQH6rCYTKLt6QmDvGKUbrYwPQ
w/3CIewkm95yACA7b0tAPfY91W3POau3/rALmDBOkiw=
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/bj5nx_39wIbU82m1VPS_VmsgvoM>
Subject: Re: [COSE] [Rats] RAM requirements for COSE/CWT
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: Tue, 22 Feb 2022 19:45:32 -0000
I’ve put the text that EAT has profiles CBOR encoding in below. > On Feb 22, 2022, at 11:09 AM, Carsten Bormann <cabo@tzi.org> wrote: > > On 2022-02-22, at 18:08, Laurence Lundblade <lgl@island-resort.com> wrote: >> >> EAT allows for use of the different CBOR serializations just like COSE and CWT so particular deployments can choose what is best for them. It is important to continue to allow all serializations in EAT for the reasons that they exist in the first place. > > This is confusing terminology. > You wouldn’t call putting space after a comma in JSON “different serializations”. > That is just the lenience that the format provides. > The fixed length argument example you give is one of the reasons we put in that lenience in the first place: > >> The main example I can think of is EAT in pure HW (e.g., a TPM-like chip that outputs EAT). Outputting fixed length integers will make that HW simpler. > > Any CBOR decoder will be happy with decoding this. True, but decoders aren’t actually required to so by RFC 8949, right? Second paragraph here <https://www.rfc-editor.org/rfc/rfc8949.html#name-preferred-serialization>. > >> EAT goes one step further than COSE and CWT by pointing out that different serializations can cause interoperability issues > > There is only one place I have found so far where EAT actively causes an interoperability issue: By ruling out preferred serialization for floating point values. Creating a separate CBOR dialect by ruling out half-precision encoding might save 8 lines of C code in a decoder (which you can simply copy from https://www.rfc-editor.org/rfc/rfc8949.html#name-half-precision), It’s not just 8 line of code because it requires a floating library and/or floating-point hardware. That isn’t available in some places. For example some implementations of Arm TrustZone don’t support it. > but ensures that a standard CBOR encoder cannot be used without supplying encoding options. Not a smart move. Seems like it would be dumb for a CBOR encoder to use floating point for the cti claim. Would some really do that? > >> and advises that a profile that specifies the serialization used be created for each use case. (Note that serialization variation is minor compared to algorithm selection and key identification and distribution) > > That is highly misleading. > >> It seems true to me that there are CBOR serialization variants that would not interoperate. Sounds a little bad and messy... > > If you create multiple incompatible variants by restricting the format, you can create non-interoperating dialects. Don’t do that then. The serialization that is of the most concern is indefinite lengths for strings and maps. CBOR, COSE and CWT all allow them and there is advantage to use them on the encoding side so they shouldn’t be ruled out. The decode for them is definitely more work and makes the decoder larger. For example, indefinite length strings need to be coalesced in to one and that requires a memory allocator or at least more memory management and copying than definite length strings. QCBOR’s decode API is the same for indefinite length maps and arrays as it for definite length maps and arrays, but that wasn’t easy to implement. I think some decoders require the protocol implementor to be conscious of the distinction. I think the indefinite length interoperability problem is not large, because indefinite lengths are rarely used, but it is still something. I’m open to suggestions on how to better handle this in EAT. LL Text from EAT’s profile discussion 7.2.2. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.2>CBOR Map and Array Encoding <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#name-cbor-map-and-array-encoding> The profile should indicate whether definite-length arrays/maps, indefinite-length arrays/maps or both are allowed. A good default is to allow only definite-length arrays/maps. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.2-1> An alternate is to allow both definite and indefinite-length arrays/maps. The decoder should accept either. Encoders that need to fit on very small hardware or be actually implement in hardware can use indefinite-length encoding. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.2-2> This applies to individual EAT claims, CWT and COSE parts of the implementation. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.2-3> 7.2.3. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.3>CBOR String Encoding <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#name-cbor-string-encoding> The profile should indicate whether definite-length strings, indefinite-length strings or both are allowed. A good default is to allow only definite-length strings. As with map and array encoding, allowing indefinite-length strings can be beneficial for some smaller implementations. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.3-1> 7.2.4. <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#section-7.2.4>CBOR Preferred Serialization <file:///Users/lgl/Documents/EAT/eat-drafts/master-ref/draft-ietf-rats-eat.html#name-cbor-preferred-serializatio> The profile should indicate whether encoders must use preferred serialization. The profile should indicate whether decoders must accept non-preferred serialization.
- [COSE] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Hannes Tschofenig
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Michael Richardson
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Jeremy O'Donoghue
- Re: [COSE] [Cbor] [Rats] RAM requirements for COS… Carsten Bormann
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Laurence Lundblade
- Re: [COSE] [Rats] RAM requirements for COSE/CWT Anders Rundgren