Re: [COSE] [Rats] RAM requirements for COSE/CWT

Anders Rundgren <anders.rundgren.net@gmail.com> Wed, 23 February 2022 08:04 UTC

Return-Path: <anders.rundgren.net@gmail.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 127D83A0105; Wed, 23 Feb 2022 00:04:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.812
X-Spam-Level:
X-Spam-Status: No, score=-2.812 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.714, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, 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 Ryr0FledTLyX; Wed, 23 Feb 2022 00:04:53 -0800 (PST)
Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 A49433A0DE6; Wed, 23 Feb 2022 00:04:52 -0800 (PST)
Received: by mail-wm1-x32f.google.com with SMTP id l1-20020a7bcf01000000b0037f881182a8so1000558wmg.2; Wed, 23 Feb 2022 00:04:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=IvVVao6DJO68urybEJolaHijejHrei5Aad3R0QIsyXw=; b=hnr1hMpXjVTDCVMiY4JSRcN+mvMLLovaliqwZnZnN3HfNwDOw3u1XOX3jAy1SkGkwT GnGSO/huakBftqM6R407h7x8k6ANCN0OiYHDrpJab6LvemVKu9Bys3QIPMRy8sI22AlI P6MXB/7WlRrTqI3ExjcTZIkZAnB7yKFplcZtHoeheiN/lCXqv1zJ6Fazl0uOUROHQWEr 7hQrxzVQA5rEckf4jeXOdWRTUT0STrmEXHh+pRrlWLvsmVIdcgA1M4WSxIfMqK6TyCYw V1lOMwZBbTPfpveLjfkw5Msoj3a3oEM+jLuqwtMtfQC3IoaQtXaJH6MW84r/zXY9hvS7 NMTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=IvVVao6DJO68urybEJolaHijejHrei5Aad3R0QIsyXw=; b=0qjrFUYv3pSKFP9/wD/a53bbUiawmgILX3w60917HkRICSwiLvdO5/Jt+SCBEPFOCB QB9qqGsyku5ypZ2VLp1tYGrPXzkywse6/koSrGYOxhVFtcuqjz+nTaaN7NzJ4rxwBCwj ro1psgrPsb8T0NrtrNCZ3Yg6lwHHrVsZopo5+w87jRA9C3NRFNkGg1TGdR0E1Rr2sOOE rQfVU9p/mqOEecx8n5HiT9blRZgGTlCDsSlvdyb0rch7gJoouQaoPKuSGfreHOi+3rF1 tI8dgV5LrzGKp8W3JvzcRcQNEY5zQNhugUYwAk8gGhqfgDbORQWmrxkNLMZAFpj02c4L 2H1g==
X-Gm-Message-State: AOAM5319lzft4vgZcFEEoGKm3RvZczwMIR/CWSbGcXT49dqqZwFBpeWE zBXy+RObOLF3gMwMs3xvz4QpUAl9RqQ=
X-Google-Smtp-Source: ABdhPJwty5uYbPZrtwXTwQbPcfNSO7cDE09Cd2D07HkuwYCINKHGSj2wQOAgWScPWfRsjFSciyARkw==
X-Received: by 2002:a1c:7311:0:b0:37c:3ceb:71c3 with SMTP id d17-20020a1c7311000000b0037c3ceb71c3mr6296074wmb.154.1645603488801; Wed, 23 Feb 2022 00:04:48 -0800 (PST)
Received: from [192.168.1.67] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id j30sm4866985wms.2.2022.02.23.00.04.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Feb 2022 00:04:48 -0800 (PST)
Message-ID: <d0be0144-3245-04c7-7de3-4dfb1b6ad77e@gmail.com>
Date: Wed, 23 Feb 2022 09:04:45 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1
Content-Language: en-US
To: Laurence Lundblade <lgl@island-resort.com>, Carsten Bormann <cabo@tzi.org>
Cc: "rats@ietf.org" <rats@ietf.org>, "cose@ietf.org" <cose@ietf.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> <ED025590-3CA0-42B8-B50E-030D94FA88D6@island-resort.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <ED025590-3CA0-42B8-B50E-030D94FA88D6@island-resort.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/3oLvzFIi-f2YkWwa3PjIWXEZKqA>
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: Wed, 23 Feb 2022 08:04:59 -0000

Hi Folks,

IMO, deterministic serialization makes no sense if decoders anyway are more or less obliged to cope with anything that smells like CBOR.

As a comparison, JavaScript's JSON object offers zero serialization options (*). This enables users to concentrate on their application. The same goes for Google's Protocol Buffer.

There is obviously (IMO of course...), room for a comparable (but potentially better) solution for CBOR.  I would be interested to hear how YOU would design such a thing.

BTW, deterministic encoding of IEEE 754 numbers can be performed without a math library:
https://github.com/cyberphone/openkeystore/blob/82543e8b7ad421e950366ed6a4acac4c3311f64d/library/src/org/webpki/cbor/CBORFloatingPoint.java#L47
https://github.com/laurencelundblade/QCBOR/blob/master/src/ieee754.c

Cheers,
Anders

*) For you nit-pickers: That 1.0 and 1 are equivalent may be regarded as a serialization option but that's not comparable to more fundamental stuff like indefinite-length encoding.