Re: [dispatch] draft-devault-bare-07 to be discussed during IETF 114

Anders Rundgren <anders.rundgren.net@gmail.com> Thu, 28 July 2022 10:04 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0731CC13631F for <dispatch@ietfa.amsl.com>; Thu, 28 Jul 2022 03:04:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 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.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id INC50u2gOXAL for <dispatch@ietfa.amsl.com>; Thu, 28 Jul 2022 03:04:31 -0700 (PDT)
Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C45EC14F72C for <dispatch@ietf.org>; Thu, 28 Jul 2022 03:04:31 -0700 (PDT)
Received: by mail-wr1-x434.google.com with SMTP id j7so1550035wrh.3 for <dispatch@ietf.org>; Thu, 28 Jul 2022 03:04:31 -0700 (PDT)
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 :references:from:in-reply-to:content-transfer-encoding; bh=lBmrfB1//HnkyeMib+rmuwlLMThwOWef5bNFE+X2Z5c=; b=gYOaiB9cEiMN9PL2x0Di4GHyTsNaevJWR7hW1zmValGQaCpMvxplKXt5cdCR5Cob8H Z9HFzTavvFW0l/+F9Aq7dxwpdNDeqEk1D9v9ITGVPvorPz76z1ApyGJnQqqJfk4ozDYZ 6MyxEkZQOc7C+OPrgw6ReBK2kfvab6Y2LyKI3TAXhEY24NDwNUMhCbWa6kGwA5GDLOIr /nYmEmfhgksNz8ek8luu3TkXf6I7M5N/7QbJ75QKIOGXAwht6K8vcdj940FzaKgLeO24 S6iFmGdS666fPylYbYStlTCCHbvJy4Ux9gKb/wOEM3fVYDR+yUP/9k68FYH1+Bqg8McX A4fg==
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:references:from:in-reply-to :content-transfer-encoding; bh=lBmrfB1//HnkyeMib+rmuwlLMThwOWef5bNFE+X2Z5c=; b=n2GgI5fT3qA+nums4J+FYRdiW/SWE7EhEGMyViSccsPTY3trMrxIio2C69HerCRilD /ZKqhn257211xzlAHG7dYvbR0JRDhEkMAb0Q2trPaRqEEyQmW5CgUPd80iYv1DcwL2Oi XHE51TKnGumS9s+uPI8lQUJyOTClN93q4H6Z8JL2ESIxSNn4iHnRiDhjokJYNWRyjOci TanGa6JclXZOYJHRPtrUabsvz5LjXUNgy+XJh+cerl8DonQ6IZx3QbluuvJGeDUr78JM AXJhPPnPUQiBUhJWZW5/YL+wcpoGCjSuBxWq5H45d9BJrI2N7490QCwt6m0mZtNFLmx3 5nPg==
X-Gm-Message-State: AJIora/x/n+AMBbUZV/B110TSPaReFJbKujBIMWfDimMKucw4Fq8uSTw T2WzFl8qEHKHE/wjUkq8F3TX6dgMcw0=
X-Google-Smtp-Source: AGRyM1tIb/vcUbG9XSnxeAkDv/NIrPwjcMuxUc8DLFhsJYrSQA9mi3G74MZ1jnsQ+skDr3AMH9OiNQ==
X-Received: by 2002:a5d:6c65:0:b0:21d:b7c0:9930 with SMTP id r5-20020a5d6c65000000b0021db7c09930mr16374227wrz.500.1659002669411; Thu, 28 Jul 2022 03:04:29 -0700 (PDT)
Received: from ?IPV6:2a01:e34:ec4e:5670:b0d5:55d1:2701:5d5a? ([2a01:e34:ec4e:5670:b0d5:55d1:2701:5d5a]) by smtp.googlemail.com with ESMTPSA id h6-20020a05600c350600b003a38606385esm2011179wmq.3.2022.07.28.03.04.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jul 2022 03:04:29 -0700 (PDT)
Message-ID: <b697d2de-b6f4-a3b4-68b4-ce13305d2502@gmail.com>
Date: Thu, 28 Jul 2022 12:04:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0
Content-Language: en-US
To: sir@cmpwn.com, dispatch@ietf.org
References: <YqC0MHD7MPpcFEuc@cvut.cz> <CAL02cgRVtSdkJxNe50ZLVQgF=3OWaBOC56X_wSdDgEgxovSCng@mail.gmail.com> <YuDxASssK9VtXO05@cvut.cz> <d60e3aad-221a-a7d1-9b34-7bd8b39d6a0c@gmail.com> <YuI9hC33bHV2H84M@cvut.cz> <dacf0f96-1e1f-8ae1-e838-6c39cf120a81@gmail.com> <YuJOD8c60mrUsDYf@cvut.cz>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <YuJOD8c60mrUsDYf@cvut.cz>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/1Zhv2QbUjdBQESeQ4QaI49fx5o4>
Subject: Re: [dispatch] draft-devault-bare-07 to be discussed during IETF 114
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2022 10:04:35 -0000

On 2022-07-28 10:51, Jiri Vlasak wrote:
>>> Please, note that BARE can not achieve full canonicity -- we need full
>>> compliance to IEEE 754 (e.g. NaN values from sensors or infinity in
>>> mathematical computations).
>>
>> You mean that using variant NaNs for "signaling" is a target for BARE?
>> This concept is probably not overly useful since it is not supported
>> by many platforms.
> 
> BARE target is full compliance to IEEE 754. The design decision is based
> on the feedback [1].

I understand but I am less convinced that NaN + payload actually is used since its support by programming platforms seems pretty scarce to say the least.


> 
>>>> For IEEE floating point data, I would consider adapting the CBOR
>>>> encoding scheme so the re-serialization becomes fully compatible.
>>>
>>> I am sorry but I do not understand. Both, BARE and CBOR use IEEE 754
>>> binary formats.
>>
>> Yes, but to maintain a consistent format there should be exactly one
>> representation of every number, including NaN.
> 
> That is not so easy, as discussed in [1]. For BARE, compliance to IEEE
> 754 is more important than compliance to CBOR.

I'm sure the IEEE 754 folks felt they had to do something with all those "wasted bits" :)  Although (potentially) a good idea, it didn't get traction in JavaScript, Java, C#, etc.


> 
>> Anyway, if canonical representation is of no interest
> 
> It is. There are three problematic types with decent trade-off:
> - f32, f64: there are good reasons for full compliance to IEEE 754
> - str: encoded as utf-8 that does not have to be canonical
> - map<A><B>: using explicit alternative (list of pairs) is preferred
> 
> When broadly compatible canonical representation is needed, the simplest
> solution is to avoid the types above.
> 
>> you can safely ignore my comments :)
> 
> Not possible on my side, sorry. Your feedback is greatly appreciated. Do
> you have some use-case in mind, when canonical f32, f64 are needed?

If you take JOSE/COSE as an example they require putting the encoded data "as is" in a fixed representation (b64u/blob) in order to use the data in cryptographic contexts.  Canonicalization eliminates this step.

However, canonicalized BARE may just be an option, not a general requirement.  In the former case NaN would have to be unique not only for serialization reasons but for compatibility with existing programming platforms.

Regards,
Anders

> 
> Thanks,
> jiri
> 
> [1]: https://lists.sr.ht/~sircmpwn/public-inbox/%3CCAFFTG-a-Vci%2BkS_d_%3DuaX8kyxszqtB-79pcb5580Z9xw72V5kw%40mail.gmail.com%3E