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

Jiri Vlasak <jiri.hubacek@gmail.com> Wed, 03 August 2022 14:15 UTC

Return-Path: <jiri.hubacek@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 C69EBC15A732 for <dispatch@ietfa.amsl.com>; Wed, 3 Aug 2022 07:15:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 bwlvDfcCVE9M for <dispatch@ietfa.amsl.com>; Wed, 3 Aug 2022 07:15:55 -0700 (PDT)
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 65EFFC157B41 for <dispatch@ietf.org>; Wed, 3 Aug 2022 07:15:55 -0700 (PDT)
Received: by mail-ed1-x52d.google.com with SMTP id b16so14162821edd.4 for <dispatch@ietf.org>; Wed, 03 Aug 2022 07:15:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=n63kv/ocx9eg8Ag2x5yIozffmwQJfiZmMN9TMTOUHds=; b=AODWYu0eO236IzXZzap9bDaegx5ZqSyvIbJCc4uNYw63HxjZjoczWNveGkfikAiIIN Mr3jjnFV216vx11HwrT7sec9n9axa4pYWNSak5jMS3YaK9XlvSCqDP0G8kSN7KFt4RKm y+EPqCQ7+Hf0/S7mrQWD3jMIlBzC+MD+KTRS4xCIRXofBWVNXiCIBasH2xggVVoLur6c rRWugShDcSDo1QPoZW7A0p+EN6b9ygIxUCm8X/jsUaQGkk5ME/T1ghQuwQmC/DYomCzl 6Wg/mJgsjG+qhubewTiCQm75ULgrrLgEQHy/0biSOnCXhXpLVesBlqIoKo4cmXVGXHbj RqmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=n63kv/ocx9eg8Ag2x5yIozffmwQJfiZmMN9TMTOUHds=; b=vBa9lhz+xhWiqizD6qXZwPwLLTKGClCEaBEQOy5X0v2WTFx8pQOdW7/xaAwiNWUqHY znlOyPkN8vSSHSvwoO8EdJ6GgQu4bQiqmyRAvyDQ/k6RvLcrZ1fx/PuUUsYrQYPY0SwN Pa86smvLtv6v4REkREGaIu9+QK7O9uuW2r5s/LdprIyLx9WZYdl6jZyYnC5lloiJRM1w U77Wg49VXZLqWbZWe74ZYG8U+jkriKjVECFXHFdjW9QI70k9AMr0x33B4IMDYhgP031L 4GclF9F3Fhvlle3OvbtUDt0VtWwoL2sGiJ5PKuUojtcClhV4mdlfdzXG6mfsXuYbT3vv Kl/A==
X-Gm-Message-State: ACgBeo2tT2xFPevpNl0AJIbxbD87GMlTED+6faMK1vaSxJsGN+DI3/dD +nJaQy/tdooz/jm+z6UQZK1YUVGKvbo=
X-Google-Smtp-Source: AA6agR6cCckxBi4bbEXjTjAWLBt23OidRWvzqwvJ1bvTmyGnUY35dv/XdllgfOi/eKI9kcEPb2YHhQ==
X-Received: by 2002:a05:6402:4301:b0:43e:4d31:6ec0 with SMTP id m1-20020a056402430100b0043e4d316ec0mr2552841edc.69.1659536153841; Wed, 03 Aug 2022 07:15:53 -0700 (PDT)
Received: from cvut.cz (fw3.ciirc.cvut.cz. [147.32.71.8]) by smtp.gmail.com with ESMTPSA id j21-20020a170906279500b0073065767404sm4283478ejc.34.2022.08.03.07.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 07:15:51 -0700 (PDT)
Date: Wed, 03 Aug 2022 16:15:48 +0200
From: Jiri Vlasak <jiri.hubacek@gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Cc: sir@cmpwn.com, dispatch@ietf.org
Message-ID: <YuqDFJ3mo+6QXeGy@cvut.cz>
Mail-Followup-To: Anders Rundgren <anders.rundgren.net@gmail.com>, 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> <b697d2de-b6f4-a3b4-68b4-ce13305d2502@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <b697d2de-b6f4-a3b4-68b4-ce13305d2502@gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/hXQBqeNK-A2spZPdvkH0n-pZTQY>
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: Wed, 03 Aug 2022 14:15:55 -0000

I am sorry for longer delay.

> > > 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.

I think I understand the benefits of canonicity. Also, I think BARE can
not be fully canonical. However, decent solutions exist, as mentioned
above.

I would like to compare the problem of floating point numbers to
strings. In these situations, BARE depends on IEEE 754 and UTF-8
respectivelly. I believe it is not in the scope of BARE to circumvent
used specifications.

> 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.

There are two options for canonicalized BARE, in my opinion:
1. Use BARE schema that does not use f32, f64, str, or map.
2. Use canonical implementations of IEEE 754 and UTF-8.

When implementing BARE, it is possible to write IEEE 754 encoder/decoder
from scratch, but also it is possible to use existing library. The same
apply to strings.

Please note, that BARE is canonical when possible.