[CFRG] Re: Where should test vectors live? // Suggestion with example draft

Björn Haase <bjoern.m.haase@web.de> Fri, 20 September 2024 19:58 UTC

Return-Path: <bjoern.m.haase@web.de>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9B799C1519B6 for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 12:58:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.793
X-Spam-Level:
X-Spam-Status: No, score=-2.793 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, T_SCC_BODY_TEXT_LINE=-0.01, 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=web.de
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 Ctg2Y3RvN-Fc for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 12:58:34 -0700 (PDT)
Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 03349C1519AB for <cfrg@irtf.org>; Fri, 20 Sep 2024 12:58:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1726862312; x=1727467112; i=bjoern.m.haase@web.de; bh=f0+ovNjLarHREQCdotJhaa8zMoLfpHjwhT7fZb3TAo4=; h=X-UI-Sender-Class:Content-Type:Message-ID:Date:MIME-Version: Subject:To:References:From:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=RJ20l4EAVPTvKC9nXVjrnoUzOqPN1sZ2D7ghH0me10A2GtHJowXzYVD3rwY5YsC+ SwSvyijgcCOie7ryklqfrjQ7mj6Ewfp2CRarVHg5+86sUmjKVzLflpg4bjLlLpf6U /rtXk+2A61ZMiIaKZdcQTUxTAst54w7nHp9bwlo/vsITMmscHiscJYjvREzs9pVkO de9TKuc8oEMjQBQYGM/TxL9LtzKKPG/tspNU2Vy385bJlsanLoAxKUoeNzb4sxUNY hFnaWeUx8oepUeG2L3knknebuxx0aUt++m+VZw/AMPCj5Ic0i+qvfKc4ERuCwiQ6H n7UD62ObFYu8Q9nY/w==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from [192.168.178.42] ([37.49.35.142]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mf3ug-1sL8mQ0Egs-00iPcK for <cfrg@irtf.org>; Fri, 20 Sep 2024 21:58:32 +0200
Content-Type: multipart/alternative; boundary="------------GMZWaOPQV6ZBLdsZ2NUOWs9J"
Message-ID: <b87e7256-2c0a-48b8-ac74-52dd9cdd4c9c@web.de>
Date: Fri, 20 Sep 2024 21:58:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: cfrg@irtf.org
References: <CAG2Zi20N98cxpgjfRe6gWw1SQEoux+5P3NhLBFUfUHk_udYeFg@mail.gmail.com> <AFC838DA-68C1-476C-8823-C3BF1E38CE39@csperkins.org> <CAG2Zi23hBZjJ==G0sRwyN+w9bH3ww=G3=MC3eHY+cExqd6X57Q@mail.gmail.com> <967BBF38-8C46-4ADC-BE41-47CAE7B7A235@csperkins.org>
From: Björn Haase <bjoern.m.haase@web.de>
In-Reply-To: <967BBF38-8C46-4ADC-BE41-47CAE7B7A235@csperkins.org>
X-Antivirus: AVG (VPS 240920-4, 20.9.2024), Outbound message
X-Antivirus-Status: Clean
X-Provags-ID: V03:K1:yD9TLBkdV7kbn6sFjqEKXqcVM210a4NN3hqElqRMeirbivQpQFX 0RssM/Ip0ss+VmttAQfxsWp3rx97NE6ExFrs9dMHHv8u9K7mJMD7VgMl1CKuKzz7Nc+cED3 Hdrt2wrr+YJMIl2bIPVk0GK1pWObHYpn3pe1D3gC4o1EFBIZDP5lCWB+tltxrJAgCt2/RpM yRv4b+GPUvL7KSezIQlpw==
UI-OutboundReport: notjunk:1;M01:P0:Y5hsd2V0YUU=;HsjOyCxOgQGbxU2kaLvtiQNhn9x uXONGHTgQ9CdfhsNOEk5yhZO4Lob4v6uQGiaNLosLYNhRBg/DtVyxtoq95CuTWfee2+3H6FFJ Rymn1U6+p8MiS/Rpvyv75h/ukM8jAodi4VwB9Lk51cLOv4UfaTdmm/NiuYpui3I0omNltWiE7 R1ljT2Wrr5yNVBfITUGRTNV4An8D2ux/DOAKYUufVN7Ts2j3LiUxPYn4AexUxZkjYc6w70YSr V4Sm3kITeI+cdsamCX7/JrtUVVb3uXteJ86zYWI8+k5TFTYqK046KaIDSbwiT390xoZ+HdWeI p7pM6OXKkvN/2mXeBYYezRfz2rLcq72T0q/Ax/Ii1BsVGZ7jaiBtwuy8maRDZnpESIwXNgA5N 7wdYTYMFFohkbwwIKTV/Cy5Ber6RZdexY1jhS147fi+lcLTuyfA2wiQZCzNhUHTvJBmeE8a0u 1t5L35BNMaaTLbfg33ZPtBHgYKrhfwVKxU66LrHm7c6jVArVBVyaoGK5yWlJfwXRRrHxWa8yz KGcUTxZq8EVS90LuTpffIRP+N+5jhlLKZZuN0lHk6DoRtmhKQSmhNqa/sZ+cgVZBUtiPtrIjy NVBoj0hN5sdHtWNiXulBKiDADcYyUQCpk6TsMwCGPCw1Jg+O8GvAg1gBqDn2uPgxEyHU66kWI M8Baj2tKc1otJovPH2bkrFvBanq06x3OahMy3iZdDtx/HMIokvdYIhHOisjZd+xCxyhLfCycd jHo6tZak+VJIZAGqXMEp06SKP7n4JoHVAtt9Z7ZCcwJsa2oP7dAbAP7+/SLU4mrd3EvDhTORF 93iBMLv1HGl31tPZ8K25Zf2Q==
Message-ID-Hash: MZ5ULPWSZAS3W7QMEGFJIFVVMAZPJQ77
X-Message-ID-Hash: MZ5ULPWSZAS3W7QMEGFJIFVVMAZPJQ77
X-MailFrom: bjoern.m.haase@web.de
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [CFRG] Re: Where should test vectors live? // Suggestion with example draft
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/xVBZPEjWJ5M9tBWT40tq4w0kntI>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Owner: <mailto:cfrg-owner@irtf.org>
List-Post: <mailto:cfrg@irtf.org>
List-Subscribe: <mailto:cfrg-join@irtf.org>
List-Unsubscribe: <mailto:cfrg-leave@irtf.org>

Hi to all,

as I did spend some time just yesterday with preparing test vectors in
JSON format for the upcoming next CPace draft version, I have today
patched my test vector generation scripts for including JSON in the
original text body of the ID in line with my today's suggestion for an
answer:
Suggested answer to the question "where should test vectors for CFRG
drafts live?":

"
1.) The test vectors SHALL live in the RFC and/or ID document
2.) Test vectors SHALL be made available in form of a textual "human-readable" format using base16 encoding.
Test vectors SHOULD also BE provided redundantly in a second format that is machine-readable. It is RECOMMENDED to use a base64 encoding that
decodes to a JSON file as machine-readable format.
"

At

https://cfrg.github.io/draft-irtf-cfrg-cpace/draft-irtf-cfrg-cpace.html#name-test-vector-for-cpace-using

you see how this possibly could look like.

What do you think about the approach taken there ? Maybe have a glance
at section B.1. to B.1.1.1 . For decoding the base64 sections you could
use your preferred online base64 decoder tool.

With the approach taken there we would avoid the difficulty of
maintaining a long-term link to some server.

I think for the end-user this might be even more convenient than having
a separate link. If test vectors are anyway machine-generated by scripts
(such as for CPace) integrating test vectors as part of the text body is
not really a lot of a burden. Also you maintain the textual context
specifying which exact test vectors are included.
The price that we would be paying is that we would have to accept some
redundancy (and have to check two outputs) and a bit longer RFC documents.

As comparison you could also look at the compiled total test vector file
for the CPace draft at

https://github.com/cfrg/draft-irtf-cfrg-cpace/blob/master/testvectors.json

I think that in this file it might be not really straight-forward to
locate the right section in the large file that applies to a given
subsection of the ID appendix.

I also would appreciate feedback regarding your opinion on old-fashioned
C-language constant tables as in B.1.8. What do you think? Are plain C
test vectors useful or should still we rather only use more modern JSON
as single format instead and forget about plain old C?

Yours,

Björn.


--
Diese E-Mail wurde von AVG-Antivirussoftware auf Viren geprüft.
www.avg.com