Return-Path: <john.mattsson@ericsson.com>
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 16B44C14F6AD
	for <cfrg@ietfa.amsl.com>; Fri, 20 Sep 2024 21:58:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.254
X-Spam-Level: 
X-Spam-Status: No, score=-7.254 tagged_above=-999 required=5
	tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5,
	RCVD_IN_ZEN_BLOCKED_OPENDNS=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=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
	header.d=ericsson.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 JnEWuj4lR4sL for <cfrg@ietfa.amsl.com>;
	Fri, 20 Sep 2024 21:58:11 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on20600.outbound.protection.outlook.com
 [IPv6:2a01:111:f403:2614::600])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by ietfa.amsl.com (Postfix) with ESMTPS id 00453C14F6A0
	for <cfrg@irtf.org>; Fri, 20 Sep 2024 21:58:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=zOsOePrlxdfuqHcXKn72iJcaD3RvkUsr26sFBp4VhyBcjF0wZNlaZWlVXn7511yb7PNtDXtRYYoG3sPdmNWr1/d+Ap8wq7yRks2OtxTy08lyRIgBitz8j5/uniGYyK7C2TLrMqq8bCfnvxnjQppv2oGIW9t1Dms2pATY/16EoewTwSklO00eJBGKACJP3nyJfvFWQpPKt7ZRBcsqcaisPwLqxugKnO1VNIVmZVLRMVEbkHLaC8gdgT4rR4K/WBksDsIA1ddSKc00764cdXgoLlzRtpnxxnzwcq9Tvh5HKSt2Z8hHERWUf8QADeYnXgBcP0IawwzDLsrwjYgUIgA0Nw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KGBDYEsjHWm74LkUWjPB7l25zGhoUrG26GNqnhb0ej0=;
 b=qCCZtpmAIARavvVYjkXBzQiQbWBIxFzZpZncTW0ST9tyzaaIMJVuMspYlGnfydmKkZmbwMqVcvWMoqajslrZkKI0r7/TrNYouKFJUOQzsAXdN3F9rXRQd3Im3K88nZTmlhHefYF5QVjR0YMwxI2+eKe5a79qBxiYp2LVEtoOJfzYyWsqvQDNXm/TaP7yOwyd2u2UhaV7QhdfPWXI/D6F84ayMgpgaNATt/fKSOTAZ3BIvzPLsXbbmxoit3F9yLgmOnyMSVsYPa+SMji5fFBggjr9HXPYUYKQLD5Frvj0sGGNWLiY+ODoaPHY1unIOcyQV4+8LYl5a+VQ1j2m9lY65Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com;
 dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KGBDYEsjHWm74LkUWjPB7l25zGhoUrG26GNqnhb0ej0=;
 b=PVZ9kzqq56QFHykR1lf/fT24pUAZgpWXWWjK0AMdXCIVh0WJnuVLV1CaVhbpkwtJtgNDiQk84eSFAgFBl6TvqnVFRKlVG7sEs8Td5RpYps+dl9iS3mfbgi44Vc012NRmc/pR2t4OzoGQO8B1GCFEWqKkl5/oCOggVAxMYLigX8R4R3Xhsb7duXh4Uu4lrkA7ahltRXYH2IWTPFpsiPlfQG7pufbFT4IYpXbh7bom6rD4vfl2aU9u4IvjdpwCAHcmq6EmFnKhtgKTMyFrbaMzUTDlg5ycZ3EwcDXC2PBOXspKYN+nuxnYnXcydJi/MGuZJWBFjpcG+i5zbBzU9lLLoA==
Received: from GVXPR07MB9678.eurprd07.prod.outlook.com (2603:10a6:150:114::10)
 by GVXPR07MB9917.eurprd07.prod.outlook.com (2603:10a6:150:121::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Sat, 21 Sep
 2024 04:58:07 +0000
Received: from GVXPR07MB9678.eurprd07.prod.outlook.com
 ([fe80::bcf3:3f45:888e:a4b8]) by GVXPR07MB9678.eurprd07.prod.outlook.com
 ([fe80::bcf3:3f45:888e:a4b8%4]) with mapi id 15.20.7982.018; Sat, 21 Sep 2024
 04:58:07 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: Christopher Patton <cpatton=40cloudflare.com@dmarc.ietf.org>,
	"cfrg@irtf.org" <cfrg@irtf.org>
Thread-Topic: [CFRG] Re: Where should test vectors live?
Thread-Index: 
 AQHbCvkbomwU7QduekSKv3Exw7kAirJgfpyAgABxMYCAAARuAIAAAvkAgAAi2QCAAC0VgIAAZsS/
Date: Sat, 21 Sep 2024 04:58:07 +0000
Message-ID: 
 <GVXPR07MB96788E2243EC05BF3A8E6DBF896D2@GVXPR07MB9678.eurprd07.prod.outlook.com>
References: 
 <CAG2Zi22ya_6h1Q_rs9Tf6tJ3qao-X2_wWhCgxoXD3OQnf+MOUw@mail.gmail.com>
 <20240920200220.402868.qmail@cr.yp.to>
 <CAG2Zi21QNTZ8rZ-j5nrkbRbrk4pdknXjdsCiLip30HjvweK9HA@mail.gmail.com>
In-Reply-To: 
 <CAG2Zi21QNTZ8rZ-j5nrkbRbrk4pdknXjdsCiLip30HjvweK9HA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: GVXPR07MB9678:EE_|GVXPR07MB9917:EE_
x-ms-office365-filtering-correlation-id: f4239d35-b86a-453b-ee8e-08dcd9f9fb9a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700018;
x-microsoft-antispam-message-info: 
 =?us-ascii?Q?jJLlyuS8b6ySxcR7YntdM8KqvoBduXy3yxfEGM5BgZflAasYBFnbbPl7z+ra?=
 =?us-ascii?Q?Xwh7CB7WwdnUk9iMCIkJox+LuuyEJeqiuhKk51Vx209H/oSMJ+vB5aj443Md?=
 =?us-ascii?Q?F8gQwgf0yE1sJE72E8C9/rqmXs5AuAD+skcxFnlf731QEM6/PNcs59vxcjqo?=
 =?us-ascii?Q?U0jGlP9MnZIGoXv8kqEmSXKkP6xKr2gKospTKUkJTQwuUt1+wR83+P2JFmH3?=
 =?us-ascii?Q?FDMCXPXbP9PpZXTk76x/GbEEze+UjB0VMzak+gLAsk8vrcU7bovL+HKjaFWn?=
 =?us-ascii?Q?JtaqjJMRxDrp5nD9N9JOn52DCwRNH/lGChefWeK3POUCv5AYY6SHXGjqdTn7?=
 =?us-ascii?Q?X3JHfjVqIKCgong11fa0t2/zug7n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oVbqU1UJMRyFNhv36XvUChYdeP?=
 =?us-ascii?Q?2aDntQmmzv+fouD62JQWgXZmyCAjNkzqn+BT9ebepg613e13vUIB/MAG7eqt?=
 =?us-ascii?Q?aSw=3D?=
x-forefront-antispam-report: 
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GVXPR07MB9678.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 
 =?us-ascii?Q?EL6TUsjzdSknk2dbefdkNsBEiqt+y9Aj9iKHVprqNlOfwymbFaRcr/8Aw2cz?=
 =?us-ascii?Q?N26yOi3VaYt5PRtVNfKc2iowHS+2/foWUzHHfYCifBzQiQI3mWFqtAbiKoOk?=
 =?us-ascii?Q?W+pWIz57LkZC47n3crzFKXXubuItfKpZVI0d4Jv9i+WR1trg3z0ome4AbMA4?=
 =?us-ascii?Q?TqthzqGM9IX1PiuI0Y+TgDbT7mSyP2LHwu4OC4YfLhTmoDnJ9CoZLV+K8PVN?=
 =?us-ascii?Q?yq0f16ahC6LdmfP81RtmCr3FJnWin0PEV2sVVYw3dwuhFnTbj6ZSkY/93OUb?=
 =?us-ascii?Q?hfa17HXlT47/b/20yjMEKGMPzynUZHGYd8lgCoj5sSMb/+M8uTyGBOh3w/t3?=
 =?us-ascii?Q?Ur+i4wcgUvKWoSjcugrbePP2kvaErWRAcTHbLAlgX9Ks0Dj2fb+yJP+Hproz?=
 =?us-ascii?Q?LY4ux3dAH4x83Cu/nLboU0xANXYWzMeq+AeXU1PDHPoDZLZDfrEja7fxJbtT?=
 =?us-ascii?Q?RwXK79vN/hTTO+fyOSpo4rRdJwT7xdsZxkPuQy4dR9IFldlHIPqCGnmeAVYq?=
 =?us-ascii?Q?aALw5ChVdJW5Z/6jfQ6HzJucrEAaYcaY0lM71SSxskP27z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 =?us-ascii?Q?2gxGZUmq9VscD9myFjLQpW6gKqcyGhDCyh3KEoXpznNcV2T3QaNzvHJoLCPW?=
 =?us-ascii?Q?czTB09AZ9SpwDyJl3Ah3hY0icW+uLTzoAC5tyDzxF9JqSm51ODMdleDyDh5g?=
 =?us-ascii?Q?73ySgvaEDz9277j83dflXiJuOUNpY06m5IPlX0hYZ4dcFukqgBK4AD1j8MTi?=
 =?us-ascii?Q?ToX484LYuPGFRpCyDgw3seM=3D?=
Content-Type: multipart/alternative;
	boundary="_000_GVXPR07MB96788E2243EC05BF3A8E6DBF896D2GVXPR07MB9678eurp_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: GVXPR07MB9678.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 
 f4239d35-b86a-453b-ee8e-08dcd9f9fb9a
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2024 04:58:07.0809
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 
 ypukte71EON8PRrOE9sLreMVeRtI/ETsLd+IPIcGJXVHE3ejqL+oIdnXqo2+GO4eBNLE/uhmFKMINj12sbvCTZuX+pB1P+xmrWGVnNxwSu4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR07MB9917
Message-ID-Hash: FQZK3WY64WADFTZOW5VQIXRNG2HRMDKV
X-Message-ID-Hash: FQZK3WY64WADFTZOW5VQIXRNG2HRMDKV
X-MailFrom: john.mattsson@ericsson.com
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: =?utf-8?q?=5BCFRG=5D_Re=3A_Where_should_test_vectors_live=3F?=
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/cfrg/VJQMAvElCUk050C7rkXdG-X7oTk>
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>

--_000_GVXPR07MB96788E2243EC05BF3A8E6DBF896D2GVXPR07MB9678eurp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

D. J. Bernstein wrote:
>Instead of defining formats for test vectors, I would suggest defining a
>format for reference code (e.g., Python script meeting a specified API;
>can have the format say which Python version). An obvious illustration
>of using the format would be a general-purpose tool to create test
>vectors given the reference code---and then there's no reason to post
>the test vectors; people should run the tools locally.

Reference code only produces positive test vectors. Unless all inputs are v=
alid, negative test vectors are essential for catching non-compliant implem=
entations such as ECC implementations not doing point validation. Negative =
test vectors typically have to be hand crafted.

Cheers,
John

From: Christopher Patton <cpatton=3D40cloudflare.com@dmarc.ietf.org>
Date: Saturday, 21 September 2024 at 00:44
To: cfrg@irtf.org <cfrg@irtf.org>
Subject: [CFRG] Re: Where should test vectors live?

Dan,


Instead of defining formats for test vectors, I would suggest defining a
format for reference code (e.g., Python script meeting a specified API;
can have the format say which Python version). An obvious illustration
of using the format would be a general-purpose tool to create test
vectors given the reference code---and then there's no reason to post
the test vectors; people should run the tools locally. SUPERCOP already
generates tests for thousands of C implementations meeting the SUPERCOP
API, and there are examples online of how to do the same tests in
Python. SUPERCOP also supports generating implementation-specific tests;
this is sometimes useful for testing slow-to-find corner cases.

One advantage of this modularity is that implementors will easily be
able to swap in different testing tools (e.g., using fuzzers, or simply
testing more inputs) without being constrained by the limits of posted
test vectors. Of course, reference code is also useful for much more
than just testing.

The draft in question does have reference code (https://github.com/cfrg/dra=
ft-irtf-cfrg-vdaf/tree/main/poc/vdaf_poc), and in fact we use this to gener=
ate test vectors and the spec itself (by copy-pasting). The reference code =
is Python, but it requires SageMath to run (e.g., `sage -python gen_test_ve=
c.py` to generate test vectors). It would be really cool to see implementer=
s integrate the reference code itself into their tests, though I think sage=
 is too big a dependency to carry around. We could probably remove it for t=
his particular draft.

I think Python is by far the most common language for reference code at CFR=
G. Some drafts require sage, others don't.

You may be interested in reviewing https://github.com/cfrg/draft-irtf-cfrg-=
cryptography-specification.

Chris P.


--_000_GVXPR07MB96788E2243EC05BF3A8E6DBF896D2GVXPR07MB9678eurp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Aptos;
	panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style>
</head>
<body lang=3D"en-SE" link=3D"blue" vlink=3D"purple" style=3D"word-wrap:brea=
k-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">D. J. Bernstein wrote:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;Instead of defining formats for test vectors, I =
would suggest defining a<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;format for reference code (e.g., Python script m=
eeting a specified API;<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;can have the format say which Python version). A=
n obvious illustration<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;of using the format would be a general-purpose t=
ool to create test<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;vectors given the reference code---and then ther=
e's no reason to post<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">&gt;the test vectors; people should run the tools lo=
cally.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">Reference code only produces positive test vectors. =
Unless all inputs are valid, negative test vectors are essential for catchi=
ng non-compliant implementations such
 as ECC implementations not doing point validation. Negative test vectors t=
ypically have to be hand crafted.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;mso-f=
areast-language:EN-US">John<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;mso-fareast-language=
:EN-US"><o:p>&nbsp;</o:p></span></p>
<div id=3D"mail-editor-reference-message-container">
<div>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt"><b><span style=3D"col=
or:black">From:
</span></b><span style=3D"color:black">Christopher Patton &lt;cpatton=3D40c=
loudflare.com@dmarc.ietf.org&gt;<br>
<b>Date: </b>Saturday, 21 September 2024 at 00:44<br>
<b>To: </b>cfrg@irtf.org &lt;cfrg@irtf.org&gt;<br>
<b>Subject: </b>[CFRG] Re: Where should test vectors live?<o:p></o:p></span=
></p>
</div>
<div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">Dan,<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;padding:0c=
m 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class=3D"MsoNormal">Instead of defining formats for test vectors, I woul=
d suggest defining a<br>
format for reference code (e.g., Python script meeting a specified API;<br>
can have the format say which Python version). An obvious illustration<br>
of using the format would be a general-purpose tool to create test<br>
vectors given the reference code---and then there's no reason to post<br>
the test vectors; people should run the tools locally. SUPERCOP already<br>
generates tests for thousands of C implementations meeting the SUPERCOP<br>
API, and there are examples online of how to do the same tests in<br>
Python. SUPERCOP also supports generating implementation-specific tests;<br=
>
this is sometimes useful for testing slow-to-find corner cases.<br>
<br>
One advantage of this modularity is that implementors will easily be<br>
able to swap in different testing tools (e.g., using fuzzers, or simply<br>
testing more inputs) without being constrained by the limits of posted<br>
test vectors. Of course, reference code is also useful for much more<br>
than just testing.<o:p></o:p></p>
</blockquote>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">The draft in question does have reference code (<a h=
ref=3D"https://github.com/cfrg/draft-irtf-cfrg-vdaf/tree/main/poc/vdaf_poc"=
>https://github.com/cfrg/draft-irtf-cfrg-vdaf/tree/main/poc/vdaf_poc</a>), =
and in fact we use this to generate
 test vectors and the spec itself (by copy-pasting). The reference code is =
Python, but it requires SageMath to run (e.g., `sage -python gen_test_vec.p=
y` to generate test vectors). It would be really cool to see implementers i=
ntegrate the reference code itself
 into their tests, though I think sage is too big a dependency to carry aro=
und. We could probably remove it for this particular draft.<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">I think Python is by far the most common language fo=
r reference code at CFRG. Some drafts require sage, others don't.<o:p></o:p=
></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">You may be interested in reviewing <a href=3D"https:=
//github.com/cfrg/draft-irtf-cfrg-cryptography-specification">
https://github.com/cfrg/draft-irtf-cfrg-cryptography-specification</a>.<o:p=
></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">Chris P.<o:p></o:p></p>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

--_000_GVXPR07MB96788E2243EC05BF3A8E6DBF896D2GVXPR07MB9678eurp_--

